diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 06dd9ec9b2409..67d98326555ef 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -379,7 +379,7 @@ com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0 com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;1.0.0;1.1.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.8;1.0.0-beta.9 +com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.8;1.0.0 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purview;1.0.0-beta.3;1.0.0-beta.4 diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index 2ab20534e6823..780c12c7f7188 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History -## 1.0.0-beta.9 (Unreleased) +## 1.0.0 (2024-12-26) -### Features Added - -### Breaking Changes - -### Bugs Fixed +- 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). ### Other Changes +- Release for Azure Resource Manager Security client library for Java. + ## 1.0.0-beta.8 (2024-12-23) - Azure Resource Manager Security client library for Java. This package contains Microsoft Azure SDK for Security Management SDK. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index 837645e4ec5d5..a768255a18d07 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.8 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/security/azure-resourcemanager-security/SAMPLE.md b/sdk/security/azure-resourcemanager-security/SAMPLE.md index e095850a82126..a0765d25ba822 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -24,13 +24,6 @@ - [UpdateSubscriptionLevelStateToInProgress](#alerts_updatesubscriptionlevelstatetoinprogress) - [UpdateSubscriptionLevelStateToResolve](#alerts_updatesubscriptionlevelstatetoresolve) -## AlertsSuppressionRules - -- [Delete](#alertssuppressionrules_delete) -- [Get](#alertssuppressionrules_get) -- [List](#alertssuppressionrules_list) -- [Update](#alertssuppressionrules_update) - ## AllowedConnections - [Get](#allowedconnections_get) @@ -46,16 +39,6 @@ - [OffboardAzureApiManagementApi](#apicollections_offboardazureapimanagementapi) - [OnboardAzureApiManagementApi](#apicollections_onboardazureapimanagementapi) -## ApplicationOperation - -- [CreateOrUpdate](#applicationoperation_createorupdate) -- [Delete](#applicationoperation_delete) -- [Get](#applicationoperation_get) - -## Applications - -- [List](#applications_list) - ## Assessments - [CreateOrUpdate](#assessments_createorupdate) @@ -72,77 +55,11 @@ - [List](#assessmentsmetadata_list) - [ListBySubscription](#assessmentsmetadata_listbysubscription) -## AutoProvisioningSettings - -- [Create](#autoprovisioningsettings_create) -- [Get](#autoprovisioningsettings_get) -- [List](#autoprovisioningsettings_list) - -## Automations - -- [CreateOrUpdate](#automations_createorupdate) -- [Delete](#automations_delete) -- [GetByResourceGroup](#automations_getbyresourcegroup) -- [List](#automations_list) -- [ListByResourceGroup](#automations_listbyresourcegroup) -- [Update](#automations_update) -- [Validate](#automations_validate) - -## AzureDevOpsOrgs - -- [CreateOrUpdate](#azuredevopsorgs_createorupdate) -- [Get](#azuredevopsorgs_get) -- [List](#azuredevopsorgs_list) -- [ListAvailable](#azuredevopsorgs_listavailable) -- [Update](#azuredevopsorgs_update) - -## AzureDevOpsProjects - -- [CreateOrUpdate](#azuredevopsprojects_createorupdate) -- [Get](#azuredevopsprojects_get) -- [List](#azuredevopsprojects_list) -- [Update](#azuredevopsprojects_update) - -## AzureDevOpsRepos - -- [CreateOrUpdate](#azuredevopsrepos_createorupdate) -- [Get](#azuredevopsrepos_get) -- [List](#azuredevopsrepos_list) -- [Update](#azuredevopsrepos_update) - ## ComplianceResults - [Get](#complianceresults_get) - [List](#complianceresults_list) -## Compliances - -- [Get](#compliances_get) -- [List](#compliances_list) - -## Connectors - -- [CreateOrUpdate](#connectors_createorupdate) -- [Delete](#connectors_delete) -- [Get](#connectors_get) -- [List](#connectors_list) - -## CustomAssessmentAutomations - -- [Create](#customassessmentautomations_create) -- [Delete](#customassessmentautomations_delete) -- [GetByResourceGroup](#customassessmentautomations_getbyresourcegroup) -- [List](#customassessmentautomations_list) -- [ListByResourceGroup](#customassessmentautomations_listbyresourcegroup) - -## CustomEntityStoreAssignments - -- [Create](#customentitystoreassignments_create) -- [Delete](#customentitystoreassignments_delete) -- [GetByResourceGroup](#customentitystoreassignments_getbyresourcegroup) -- [List](#customentitystoreassignments_list) -- [ListByResourceGroup](#customentitystoreassignments_listbyresourcegroup) - ## CustomRecommendations - [CreateOrUpdate](#customrecommendations_createorupdate) @@ -150,39 +67,6 @@ - [Get](#customrecommendations_get) - [List](#customrecommendations_list) -## DefenderForStorage - -- [CancelMalwareScan](#defenderforstorage_cancelmalwarescan) -- [Create](#defenderforstorage_create) -- [Get](#defenderforstorage_get) -- [GetMalwareScan](#defenderforstorage_getmalwarescan) -- [StartMalwareScan](#defenderforstorage_startmalwarescan) - -## DevOpsConfigurations - -- [CreateOrUpdate](#devopsconfigurations_createorupdate) -- [Delete](#devopsconfigurations_delete) -- [Get](#devopsconfigurations_get) -- [List](#devopsconfigurations_list) -- [Update](#devopsconfigurations_update) - -## DevOpsOperationResults - -- [Get](#devopsoperationresults_get) - -## DevOpsPolicies - -- [Get](#devopspolicies_get) -- [List](#devopspolicies_list) - -## DevOpsPolicyAssignments - -- [CreateOrUpdate](#devopspolicyassignments_createorupdate) -- [Delete](#devopspolicyassignments_delete) -- [Get](#devopspolicyassignments_get) -- [List](#devopspolicyassignments_list) -- [Update](#devopspolicyassignments_update) - ## DeviceSecurityGroups - [CreateOrUpdate](#devicesecuritygroups_createorupdate) @@ -202,59 +86,6 @@ - [List](#externalsecuritysolutions_list) - [ListByHomeRegion](#externalsecuritysolutions_listbyhomeregion) -## GitHubOwners - -- [Get](#githubowners_get) -- [List](#githubowners_list) -- [ListAvailable](#githubowners_listavailable) - -## GitHubRepos - -- [Get](#githubrepos_get) -- [List](#githubrepos_list) - -## GitLabGroups - -- [Get](#gitlabgroups_get) -- [List](#gitlabgroups_list) -- [ListAvailable](#gitlabgroups_listavailable) - -## GitLabProjects - -- [Get](#gitlabprojects_get) -- [List](#gitlabprojects_list) - -## GitLabSubgroups - -- [List](#gitlabsubgroups_list) - -## GovernanceAssignments - -- [CreateOrUpdate](#governanceassignments_createorupdate) -- [Delete](#governanceassignments_delete) -- [Get](#governanceassignments_get) -- [List](#governanceassignments_list) - -## GovernanceRules - -- [CreateOrUpdate](#governancerules_createorupdate) -- [Delete](#governancerules_delete) -- [Execute](#governancerules_execute) -- [Get](#governancerules_get) -- [List](#governancerules_list) -- [OperationResults](#governancerules_operationresults) - -## HealthReports - -- [Get](#healthreports_get) -- [List](#healthreports_list) - -## InformationProtectionPolicies - -- [CreateOrUpdate](#informationprotectionpolicies_createorupdate) -- [Get](#informationprotectionpolicies_get) -- [List](#informationprotectionpolicies_list) - ## IotSecuritySolution - [CreateOrUpdate](#iotsecuritysolution_createorupdate) @@ -291,20 +122,6 @@ - [ListByResourceGroup](#jitnetworkaccesspolicies_listbyresourcegroup) - [ListByResourceGroupAndRegion](#jitnetworkaccesspolicies_listbyresourcegroupandregion) -## Locations - -- [Get](#locations_get) -- [List](#locations_list) - -## MdeOnboardings - -- [Get](#mdeonboardings_get) -- [List](#mdeonboardings_list) - -## Operations - -- [List](#operations_list) - ## Pricings - [Delete](#pricings_delete) @@ -312,21 +129,6 @@ - [List](#pricings_list) - [Update](#pricings_update) -## RegulatoryComplianceAssessments - -- [Get](#regulatorycomplianceassessments_get) -- [List](#regulatorycomplianceassessments_list) - -## RegulatoryComplianceControls - -- [Get](#regulatorycompliancecontrols_get) -- [List](#regulatorycompliancecontrols_list) - -## RegulatoryComplianceStandards - -- [Get](#regulatorycompliancestandards_get) -- [List](#regulatorycompliancestandards_list) - ## SecureScoreControlDefinitions - [List](#securescorecontroldefinitions_list) @@ -342,39 +144,6 @@ - [Get](#securescores_get) - [List](#securescores_list) -## SecurityConnectorApplicationOperation - -- [CreateOrUpdate](#securityconnectorapplicationoperation_createorupdate) -- [Delete](#securityconnectorapplicationoperation_delete) -- [Get](#securityconnectorapplicationoperation_get) - -## SecurityConnectorApplications - -- [List](#securityconnectorapplications_list) - -## SecurityConnectors - -- [CreateOrUpdate](#securityconnectors_createorupdate) -- [Delete](#securityconnectors_delete) -- [GetByResourceGroup](#securityconnectors_getbyresourcegroup) -- [List](#securityconnectors_list) -- [ListByResourceGroup](#securityconnectors_listbyresourcegroup) -- [Update](#securityconnectors_update) - -## SecurityContacts - -- [Create](#securitycontacts_create) -- [Delete](#securitycontacts_delete) -- [Get](#securitycontacts_get) -- [List](#securitycontacts_list) - -## SecurityOperators - -- [CreateOrUpdate](#securityoperators_createorupdate) -- [Delete](#securityoperators_delete) -- [Get](#securityoperators_get) -- [List](#securityoperators_list) - ## SecuritySolutions - [Get](#securitysolutions_get) @@ -392,12 +161,6 @@ - [Get](#securitystandards_get) - [List](#securitystandards_list) -## SensitivitySettings - -- [CreateOrUpdate](#sensitivitysettings_createorupdate) -- [Get](#sensitivitysettings_get) -- [List](#sensitivitysettings_list) - ## ServerVulnerabilityAssessment - [CreateOrUpdate](#servervulnerabilityassessment_createorupdate) @@ -418,30 +181,6 @@ - [List](#settings_list) - [Update](#settings_update) -## SoftwareInventories - -- [Get](#softwareinventories_get) -- [List](#softwareinventories_list) -- [ListByExtendedResource](#softwareinventories_listbyextendedresource) - -## SqlVulnerabilityAssessmentBaselineRules - -- [Add](#sqlvulnerabilityassessmentbaselinerules_add) -- [CreateOrUpdate](#sqlvulnerabilityassessmentbaselinerules_createorupdate) -- [Delete](#sqlvulnerabilityassessmentbaselinerules_delete) -- [Get](#sqlvulnerabilityassessmentbaselinerules_get) -- [List](#sqlvulnerabilityassessmentbaselinerules_list) - -## SqlVulnerabilityAssessmentScanResults - -- [Get](#sqlvulnerabilityassessmentscanresults_get) -- [List](#sqlvulnerabilityassessmentscanresults_list) - -## SqlVulnerabilityAssessmentScans - -- [Get](#sqlvulnerabilityassessmentscans_get) -- [List](#sqlvulnerabilityassessmentscans_list) - ## StandardAssignments - [Create](#standardassignments_create) @@ -449,35 +188,11 @@ - [Get](#standardassignments_get) - [List](#standardassignments_list) -## SubAssessments - -- [Get](#subassessments_get) -- [List](#subassessments_list) -- [ListAll](#subassessments_listall) - -## Tasks - -- [GetResourceGroupLevelTask](#tasks_getresourcegroupleveltask) -- [GetSubscriptionLevelTask](#tasks_getsubscriptionleveltask) -- [List](#tasks_list) -- [ListByHomeRegion](#tasks_listbyhomeregion) -- [ListByResourceGroup](#tasks_listbyresourcegroup) -- [UpdateResourceGroupLevelTaskState](#tasks_updateresourcegroupleveltaskstate) -- [UpdateSubscriptionLevelTaskState](#tasks_updatesubscriptionleveltaskstate) - ## Topology - [Get](#topology_get) - [List](#topology_list) - [ListByHomeRegion](#topology_listbyhomeregion) - -## WorkspaceSettings - -- [Create](#workspacesettings_create) -- [Delete](#workspacesettings_delete) -- [Get](#workspacesettings_get) -- [List](#workspacesettings_list) -- [Update](#workspacesettings_update) ### AdvancedThreatProtection_Create ```java @@ -908,152 +623,6 @@ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { } ``` -### AlertsSuppressionRules_Delete - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### AlertsSuppressionRules_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### AlertsSuppressionRules_List - -```java -/** - * 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, com.azure.core.util.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", com.azure.core.util.Context.NONE); - } -} -``` - -### AlertsSuppressionRules_Update - -```java -import com.azure.core.management.serializer.SerializerFactory; -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"))))), - com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - ### AllowedConnections_Get ```java @@ -1280,117 +849,6 @@ public final class ApiCollectionsOnboardAzureApiManagementApiSamples { } ``` -### ApplicationOperation_CreateOrUpdate - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.Arrays; - -/** - * Samples for ApplicationOperation CreateOrUpdate. - */ -public final class ApplicationOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * PutApplication_example.json - */ - /** - * Sample code: Create application. - * - * @param manager Entry point to SecurityManager. - */ - public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager.applicationOperations() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withDisplayName("Admin's application") - .withDescription("An application on critical recommendations") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-bil-\"}]}", - Object.class, SerializerEncoding.JSON))) - .create(); - } -} -``` - -### ApplicationOperation_Delete - -```java -/** - * Samples for ApplicationOperation Delete. - */ -public final class ApplicationOperationDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * DeleteApplication_example.json - */ - /** - * Sample code: Delete security Application. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager.applicationOperations() - .deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} -``` - -### ApplicationOperation_Get - -```java -/** - * Samples for ApplicationOperation Get. - */ -public final class ApplicationOperationGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * GetApplication_example.json - */ - /** - * Sample code: Get security application by specific applicationId. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getSecurityApplicationBySpecificApplicationId(com.azure.resourcemanager.security.SecurityManager manager) { - manager.applicationOperations() - .getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} -``` - -### Applications_List - -```java -/** - * Samples for Applications List. - */ -public final class ApplicationsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * ListBySubscriptionApplications_example.json - */ - /** - * Sample code: List applications security by subscription level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listApplicationsSecurityBySubscriptionLevelScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.applications().list(com.azure.core.util.Context.NONE); - } -} -``` - ### Assessments_CreateOrUpdate ```java @@ -1689,7151 +1147,2556 @@ public final class AssessmentsMetadataListBySubscriptionSamples { } ``` -### AutoProvisioningSettings_Create +### ComplianceResults_Get ```java -import com.azure.resourcemanager.security.models.AutoProvision; - /** - * Samples for AutoProvisioningSettings Create. + * Samples for ComplianceResults Get. */ -public final class AutoProvisioningSettingsCreateSamples { +public final class ComplianceResultsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ - * AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ + * GetComplianceResults_example.json */ /** - * Sample code: Create auto provisioning settings for subscription. + * Sample code: Get compliance results on 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 -/** - * 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", com.azure.core.util.Context.NONE); + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.complianceResults() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", + com.azure.core.util.Context.NONE); } } ``` -### AutoProvisioningSettings_List +### ComplianceResults_List ```java /** - * Samples for AutoProvisioningSettings List. + * Samples for ComplianceResults List. */ -public final class AutoProvisioningSettingsListSamples { +public final class ComplianceResultsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ - * AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ + * ListComplianceResults_example.json */ /** - * Sample code: Get auto provisioning settings for subscription. + * Sample code: Get compliance results on subscription. * * @param manager Entry point to SecurityManager. */ - public static void - getAutoProvisioningSettingsForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.complianceResults() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } ``` -### Automations_CreateOrUpdate +### CustomRecommendations_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 com.azure.resourcemanager.security.models.RecommendationSupportedClouds; +import com.azure.resourcemanager.security.models.SecurityIssue; +import com.azure.resourcemanager.security.models.SeverityEnum; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; /** - * Samples for Automations CreateOrUpdate. + * Samples for CustomRecommendations CreateOrUpdate. */ -public final class AutomationsCreateOrUpdateSamples { +public final class CustomRecommendationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * PutAutomationAllAssessments_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * PutBySecurityConnectorCustomRecommendation_example.json */ /** - * Sample code: Create or update a security automation for all assessments (including all severities). + * Sample code: Create or update custom recommendation over security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( + public static void createOrUpdateCustomRecommendationOverSecurityConnectorScope( 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"))) + manager.customRecommendations() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withQuery( + "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") + .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) + .withSeverity(SeverityEnum.MEDIUM) + .withSecurityIssue(SecurityIssue.VULNERABILITY) + .withDisplayName("Password Policy") + .withDescription("organization passwords policy") + .withRemediationDescription("Change password policy to...") .create(); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * PutDisableAutomation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * PutBySubscriptionCustomRecommendation_example.json */ /** - * Sample code: Disable or enable a security automation. + * Sample code: Create or update custom recommendation over subscription scope. * * @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"))) + public static void createOrUpdateCustomRecommendationOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingScope("subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b") + .withQuery( + "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") + .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) + .withSeverity(SeverityEnum.MEDIUM) + .withSecurityIssue(SecurityIssue.VULNERABILITY) + .withDisplayName("Password Policy") + .withDescription("organization passwords policy") + .withRemediationDescription("Change password policy to...") .create(); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * PutAutomationHighSeverityAssessments_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * PutByManagementGroupCustomRecommendation_example.json */ /** - * Sample code: Create or update a security automation for all high severity assessments. + * Sample code: Create or update custom recommendation over management group scope. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( + public static void createOrUpdateCustomRecommendationOverManagementGroupScope( 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"))) + manager.customRecommendations() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withQuery( + "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") + .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) + .withSeverity(SeverityEnum.MEDIUM) + .withSecurityIssue(SecurityIssue.VULNERABILITY) + .withDisplayName("Password Policy") + .withDescription("organization passwords policy") + .withRemediationDescription("Change password policy to...") .create(); } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } ``` -### Automations_Delete +### CustomRecommendations_Delete ```java /** - * Samples for Automations Delete. + * Samples for CustomRecommendations Delete. */ -public final class AutomationsDeleteSamples { +public final class CustomRecommendationsDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * DeleteAutomation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * DeleteBySecurityConnectorCustomRecommendation_example.json */ /** - * Sample code: Delete a security automation. + * Sample code: Delete a custom recommendation over security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations() - .deleteByResourceGroupWithResponse("myRg", "myAutomationName", com.azure.core.util.Context.NONE); + public static void deleteACustomRecommendationOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } -} -``` -### Automations_GetByResourceGroup - -```java -/** - * Samples for Automations GetByResourceGroup. - */ -public final class AutomationsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * GetAutomationResourceGroup_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * DeleteBySubscriptionCustomRecommendation_example.json */ /** - * Sample code: Retrieve a security automation. + * Sample code: Delete a custom recommendation over subscription scope. * * @param manager Entry point to SecurityManager. */ - public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", - com.azure.core.util.Context.NONE); + public static void + deleteACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .deleteByResourceGroupWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } -} -``` - -### Automations_List -```java -/** - * Samples for Automations List. - */ -public final class AutomationsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * GetAutomationsSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * DeleteByManagementGroupCustomRecommendation_example.json */ /** - * Sample code: List all security automations of a specified subscription. + * Sample code: Delete a custom recommendation over management group scope. * * @param manager Entry point to SecurityManager. */ - public static void - listAllSecurityAutomationsOfASpecifiedSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().list(com.azure.core.util.Context.NONE); + public static void deleteACustomRecommendationOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .deleteByResourceGroupWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` -### Automations_ListByResourceGroup +### CustomRecommendations_Get ```java /** - * Samples for Automations ListByResourceGroup. + * Samples for CustomRecommendations Get. */ -public final class AutomationsListByResourceGroupSamples { +public final class CustomRecommendationsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * GetAutomationsResourceGroup_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * GetByManagementGroupCustomRecommendation_example.json */ /** - * Sample code: List all security automations of a specified resource group. + * Sample code: Get a custom recommendation over management group scope. * * @param manager Entry point to SecurityManager. */ - public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); + public static void + getACustomRecommendationOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } -} -``` - -### Automations_Update - -```java -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -/** - * Samples for Automations Update. - */ -public final class AutomationsUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ - * PatchAutomation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * GetBySecurityConnectorCustomRecommendation_example.json */ /** - * Sample code: Update a security automation. + * Sample code: Get a custom recommendation over security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void updateASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - Automation resource = manager.automations() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("Example", "exampleTag")) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment") - .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"))) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void + getACustomRecommendationOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } -} -``` - -### Automations_Validate - -```java -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/2023-12-01-preview/examples/Automations/ - * ValidateAutomation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * GetBySubscriptionCustomRecommendation_example.json */ /** - * Sample code: Validate the security automation model before create or update. + * Sample code: Get a custom recommendation over subscription scope. * * @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"))), - com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void + getACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsOrgs_CreateOrUpdate +### CustomRecommendations_List ```java -import com.azure.resourcemanager.security.models.ActionableRemediation; -import com.azure.resourcemanager.security.models.ActionableRemediationState; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; -import com.azure.resourcemanager.security.models.OnboardingState; - /** - * Samples for AzureDevOpsOrgs CreateOrUpdate. + * Samples for CustomRecommendations List. */ -public final class AzureDevOpsOrgsCreateOrUpdateSamples { +public final class CustomRecommendationsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsOrgs_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * ListByManagementGroupCustomRecommendations_example.json */ /** - * Sample code: CreateOrUpdate_AzureDevOpsOrgs. + * Sample code: List custom recommendations by management group scope. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsOrgs() - .define("myAzDevOpsOrg") - .withExistingSecurityConnector("myRg", "mySecurityConnectorName") - .withProperties(new AzureDevOpsOrgProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) - .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) - .create(); + public static void + listCustomRecommendationsByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); } -} -``` - -### AzureDevOpsOrgs_Get -```java -/** - * Samples for AzureDevOpsOrgs Get. - */ -public final class AzureDevOpsOrgsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetAzureDevOpsOrgs_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * ListBySubscriptionCustomRecommendations_example.json */ /** - * Sample code: Get_AzureDevOpsOrgs. + * Sample code: List custom recommendations by subscription scope. * * @param manager Entry point to SecurityManager. */ - public static void getAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsOrgs() - .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); + public static void + listCustomRecommendationsBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } -} -``` -### AzureDevOpsOrgs_List - -```java -/** - * Samples for AzureDevOpsOrgs List. - */ -public final class AzureDevOpsOrgsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListAzureDevOpsOrgs_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ + * ListBySecurityConnectorCustomRecommendations_example.json */ /** - * Sample code: List_AzureDevOpsOrgs. + * Sample code: List custom recommendations by security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void listAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsOrgs().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + public static void + listCustomRecommendationsBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsOrgs_ListAvailable +### DeviceSecurityGroups_CreateOrUpdate ```java +import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; +import java.time.Duration; +import java.util.Arrays; + /** - * Samples for AzureDevOpsOrgs ListAvailable. + * Samples for DeviceSecurityGroups CreateOrUpdate. */ -public final class AzureDevOpsOrgsListAvailableSamples { +public final class DeviceSecurityGroupsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListAvailableAzureDevOpsOrgs_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * PutDeviceSecurityGroups_example.json */ /** - * Sample code: ListAvailable_AzureDevOpsOrgs. + * Sample code: Create or update a device security group for the specified IoT hub resource. * * @param manager Entry point to SecurityManager. */ - public static void listAvailableAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsOrgs() - .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + 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(); } } ``` -### AzureDevOpsOrgs_Update +### DeviceSecurityGroups_Delete ```java -import com.azure.resourcemanager.security.models.ActionableRemediation; -import com.azure.resourcemanager.security.models.ActionableRemediationState; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; -import com.azure.resourcemanager.security.models.OnboardingState; - /** - * Samples for AzureDevOpsOrgs Update. + * Samples for DeviceSecurityGroups Delete. */ -public final class AzureDevOpsOrgsUpdateSamples { +public final class DeviceSecurityGroupsDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/UpdateAzureDevOpsOrgs_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * DeleteDeviceSecurityGroups_example.json */ /** - * Sample code: Update_AzureDevOpsOrgs. + * Sample code: Delete a device security group for the specified IoT Hub resource. * * @param manager Entry point to SecurityManager. */ - public static void updateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { - AzureDevOpsOrg resource = manager.azureDevOpsOrgs() - .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new AzureDevOpsOrgProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) - .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) - .apply(); + public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.deviceSecurityGroups() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsProjects_CreateOrUpdate +### DeviceSecurityGroups_Get ```java -import com.azure.resourcemanager.security.models.ActionableRemediation; -import com.azure.resourcemanager.security.models.ActionableRemediationState; -import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; -import com.azure.resourcemanager.security.models.OnboardingState; - /** - * Samples for AzureDevOpsProjects CreateOrUpdate. + * Samples for DeviceSecurityGroups Get. */ -public final class AzureDevOpsProjectsCreateOrUpdateSamples { +public final class DeviceSecurityGroupsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsProjects_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * GetDeviceSecurityGroups_example.json */ /** - * Sample code: CreateOrUpdate_AzureDevOpsProjects. + * Sample code: Get a device security group for the specified IoT Hub resource. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsProjects() - .define("myAzDevOpsProject") - .withExistingAzureDevOpsOrg("myRg", "mySecurityConnectorName", "myAzDevOpsOrg") - .withProperties(new AzureDevOpsProjectProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) - .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) - .create(); + 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", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsProjects_Get +### DeviceSecurityGroups_List ```java /** - * Samples for AzureDevOpsProjects Get. + * Samples for DeviceSecurityGroups List. */ -public final class AzureDevOpsProjectsGetSamples { +public final class DeviceSecurityGroupsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetAzureDevOpsProjects_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * ListDeviceSecurityGroups_example.json */ /** - * Sample code: Get_AzureDevOpsProjects. + * Sample code: List all device security groups for the specified IoT Hub resource. * * @param manager Entry point to SecurityManager. */ - public static void getAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsProjects() - .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", + 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", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsProjects_List +### DiscoveredSecuritySolutions_Get ```java /** - * Samples for AzureDevOpsProjects List. + * Samples for DiscoveredSecuritySolutions Get. */ -public final class AzureDevOpsProjectsListSamples { +public final class DiscoveredSecuritySolutionsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListAzureDevOpsProjects_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions + * /GetDiscoveredSecuritySolutionResourceGroupLocation_example.json */ /** - * Sample code: List_AzureDevOpsProjects. + * Sample code: Get discovered security solution from a security data location. * * @param manager Entry point to SecurityManager. */ - public static void listAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsProjects() - .list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); + public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsProjects_Update +### DiscoveredSecuritySolutions_List ```java -import com.azure.resourcemanager.security.models.ActionableRemediation; -import com.azure.resourcemanager.security.models.ActionableRemediationState; -import com.azure.resourcemanager.security.models.AzureDevOpsProject; -import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; -import com.azure.resourcemanager.security.models.OnboardingState; - /** - * Samples for AzureDevOpsProjects Update. + * Samples for DiscoveredSecuritySolutions List. */ -public final class AzureDevOpsProjectsUpdateSamples { +public final class DiscoveredSecuritySolutionsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/UpdateAzureDevOpsProjects_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions + * /GetDiscoveredSecuritySolutionsSubscription_example.json */ /** - * Sample code: Update_AzureDevOpsProjects. + * Sample code: Get discovered security solutions. * * @param manager Entry point to SecurityManager. */ - public static void updateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { - AzureDevOpsProject resource = manager.azureDevOpsProjects() - .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new AzureDevOpsProjectProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) - .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) - .apply(); + public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsRepos_CreateOrUpdate +### DiscoveredSecuritySolutions_ListByHomeRegion ```java -import com.azure.resourcemanager.security.models.ActionableRemediation; -import com.azure.resourcemanager.security.models.ActionableRemediationState; -import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; -import com.azure.resourcemanager.security.models.OnboardingState; - /** - * Samples for AzureDevOpsRepos CreateOrUpdate. + * Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ -public final class AzureDevOpsReposCreateOrUpdateSamples { +public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsRepos_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions + * /GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json */ /** - * Sample code: CreateOrUpdate_AzureDevOpsRepos. + * Sample code: Get discovered security solutions from a security data location. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsRepos() - .define("myAzDevOpsRepo") - .withExistingProject("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject") - .withProperties(new AzureDevOpsRepositoryProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) - .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) - .create(); + public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsRepos_Get +### ExternalSecuritySolutions_Get ```java /** - * Samples for AzureDevOpsRepos Get. + * Samples for ExternalSecuritySolutions Get. */ -public final class AzureDevOpsReposGetSamples { +public final class ExternalSecuritySolutionsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetAzureDevOpsRepos_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ + * GetExternalSecuritySolution_example.json */ /** - * Sample code: Get_AzureDevOpsRepos. + * Sample code: Get external security solution. * * @param manager Entry point to SecurityManager. */ - public static void getAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsRepos() - .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", - com.azure.core.util.Context.NONE); + public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions() + .getWithResponse("defaultresourcegroup-eus", "centralus", + "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsRepos_List +### ExternalSecuritySolutions_List ```java /** - * Samples for AzureDevOpsRepos List. + * Samples for ExternalSecuritySolutions List. */ -public final class AzureDevOpsReposListSamples { +public final class ExternalSecuritySolutionsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListAzureDevOpsRepos_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ + * GetExternalSecuritySolutionsSubscription_example.json */ /** - * Sample code: List_AzureDevOpsRepos. + * Sample code: Get external security solutions on a subscription. * * @param manager Entry point to SecurityManager. */ - public static void listAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { - manager.azureDevOpsRepos() - .list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", - com.azure.core.util.Context.NONE); + public static void + getExternalSecuritySolutionsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); } } ``` -### AzureDevOpsRepos_Update +### ExternalSecuritySolutions_ListByHomeRegion ```java -import com.azure.resourcemanager.security.models.ActionableRemediation; -import com.azure.resourcemanager.security.models.ActionableRemediationState; -import com.azure.resourcemanager.security.models.AzureDevOpsRepository; -import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; -import com.azure.resourcemanager.security.models.OnboardingState; - /** - * Samples for AzureDevOpsRepos Update. + * Samples for ExternalSecuritySolutions ListByHomeRegion. */ -public final class AzureDevOpsReposUpdateSamples { +public final class ExternalSecuritySolutionsListByHomeRegionSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/UpdateAzureDevOpsRepos_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ + * GetExternalSecuritySolutionsSubscriptionLocation_example.json */ /** - * Sample code: Update_AzureDevOpsRepos. + * Sample code: Get external security solutions on a subscription from security data location. * * @param manager Entry point to SecurityManager. */ - public static void updateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { - AzureDevOpsRepository resource = manager.azureDevOpsRepos() - .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new AzureDevOpsRepositoryProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) - .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) - .apply(); + public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` -### ComplianceResults_Get +### 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 ComplianceResults Get. + * Samples for IotSecuritySolution CreateOrUpdate. */ -public final class ComplianceResultsGetSamples { +public final class IotSecuritySolutionCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ - * GetComplianceResults_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * CreateIoTSecuritySolution.json */ /** - * Sample code: Get compliance results on subscription. + * Sample code: Create or update a IoT security solution. * * @param manager Entry point to SecurityManager. */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.complianceResults() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", - com.azure.core.util.Context.NONE); + 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(); } -} -``` - -### ComplianceResults_List -```java -/** - * Samples for ComplianceResults List. - */ -public final class ComplianceResultsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ - * ListComplianceResults_example.json - */ - /** - * Sample code: Get compliance results on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.complianceResults() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### Compliances_Get +### IotSecuritySolution_Delete ```java /** - * Samples for Compliances Get. + * Samples for IotSecuritySolution Delete. */ -public final class CompliancesGetSamples { +public final class IotSecuritySolutionDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/ - * GetCompliance_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * DeleteIoTSecuritySolution.json */ /** - * Sample code: Get security compliance data for a day. + * Sample code: Delete an IoT security solution. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { - manager.compliances() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", - com.azure.core.util.Context.NONE); + public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` -### Compliances_List +### IotSecuritySolution_GetByResourceGroup ```java /** - * Samples for Compliances List. + * Samples for IotSecuritySolution GetByResourceGroup. */ -public final class CompliancesListSamples { +public final class IotSecuritySolutionGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/ - * GetCompliances_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolution.json */ /** - * Sample code: Get security compliance data over time. + * Sample code: Get a IoT security solution. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { - manager.compliances() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .getByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` -### Connectors_CreateOrUpdate +### IotSecuritySolution_List ```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. + * Samples for IotSecuritySolution List. */ -public final class ConnectorsCreateOrUpdateSamples { +public final class IotSecuritySolutionListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ - * CreateUpdateGcpCredentialsConnectorSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsList.json */ /** - * Sample code: gcpCredentials - Create a cloud account connector for a subscription. + * Sample code: List IoT Security solutions by subscription. * * @param manager Entry point to SecurityManager. */ - public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors() - .define("gcp_dev") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) - .withAuthenticationDetails(new GcpCredentialsDetailsProperties().withOrganizationId("AscDemoOrg") - .withType("service_account") - .withProjectId("asc-project-1234") - .withPrivateKeyId("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder") - .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") - .withClientId("105889053725632919854") - .withAuthUri("https://accounts.google.com/o/oauth2/auth") - .withTokenUri("fakeTokenPlaceholder") - .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") - .withClientX509CertUrl( - "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) - .create(); + public static void + listIoTSecuritySolutionsBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().list(null, com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ - * CreateUpdateAwsCredConnectorSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsListByIotHub.json */ /** - * Sample code: AwsCred - Create a cloud account connector for a subscription. + * Sample code: List IoT Security solutions by IoT Hub. * * @param manager Entry point to SecurityManager. */ - public static void awsCredCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors() - .define("aws_dev1") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties().withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwsCredsAuthenticationDetailsProperties().withAwsAccessKeyId("fakeTokenPlaceholder") - .withAwsSecretAccessKey("fakeTokenPlaceholder")) - .create(); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ - * CreateUpdateAwsAssumeRoleConnectorSubscription_example.json - */ - /** - * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors() - .define("aws_dev2") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties().withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails(new AwAssumeRoleAuthenticationDetailsProperties() - .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") - .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) - .create(); + 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\")", + com.azure.core.util.Context.NONE); } } ``` -### Connectors_Delete +### IotSecuritySolution_ListByResourceGroup ```java /** - * Samples for Connectors Delete. + * Samples for IotSecuritySolution ListByResourceGroup. */ -public final class ConnectorsDeleteSamples { +public final class IotSecuritySolutionListByResourceGroupSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ - * DeleteConnectorSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsListByIotHubAndRg.json */ /** - * Sample code: Delete a cloud account connector from a subscription. + * Sample code: List IoT Security solutions by resource group and IoT Hub. * * @param manager Entry point to SecurityManager. */ public static void - deleteACloudAccountConnectorFromASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + 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\")", + com.azure.core.util.Context.NONE); } -} -``` - -### Connectors_Get -```java -/** - * Samples for Connectors Get. - */ -public final class ConnectorsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ - * GetConnectorSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsListByRg.json */ /** - * Sample code: Details of a specific cloud account connector. + * Sample code: List IoT Security solutions by resource group. * * @param manager Entry point to SecurityManager. */ public static void - detailsOfASpecificCloudAccountConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + listIoTSecuritySolutionsByResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, com.azure.core.util.Context.NONE); } } ``` -### Connectors_List +### IotSecuritySolution_Update ```java +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 Connectors List. + * Samples for IotSecuritySolution Update. */ -public final class ConnectorsListSamples { +public final class IotSecuritySolutionUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ - * GetListConnectorSubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * UpdateIoTSecuritySolution.json */ /** - * Sample code: Get all cloud accounts connectors of a subscription. + * Sample code: Use this method to update existing IoT Security solution. * * @param manager Entry point to SecurityManager. */ public static void - getAllCloudAccountsConnectorsOfASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().list(com.azure.core.util.Context.NONE); + useThisMethodToUpdateExistingIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + IoTSecuritySolutionModel resource = manager.iotSecuritySolutions() + .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### CustomAssessmentAutomations_Create +### IotSecuritySolutionAnalytics_Get ```java -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; - /** - * Samples for CustomAssessmentAutomations Create. + * Samples for IotSecuritySolutionAnalytics Get. */ -public final class CustomAssessmentAutomationsCreateSamples { +public final class IotSecuritySolutionAnalyticsGetSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json */ /** - * Sample code: Create a Custom Assessment Automation. + * Sample code: Get Security Solution Analytics. * * @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(); + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_Delete +### IotSecuritySolutionAnalytics_List ```java /** - * Samples for CustomAssessmentAutomations Delete. + * Samples for IotSecuritySolutionAnalytics List. */ -public final class CustomAssessmentAutomationsDeleteSamples { +public final class IotSecuritySolutionAnalyticsListSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json */ /** - * Sample code: Delete a Custom Assessment Automation. + * Sample code: Get Security Solution Analytics. * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations() - .deleteByResourceGroupWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", - com.azure.core.util.Context.NONE); + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_GetByResourceGroup +### IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss ```java /** - * Samples for CustomAssessmentAutomations GetByResourceGroup. + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ -public final class CustomAssessmentAutomationsGetByResourceGroupSamples { +public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomAssessmentAutomations/customAssessmentAutomationGet_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json */ /** - * Sample code: Get a Custom Assessment Automation. + * Sample code: Dismiss an aggregated IoT Security Solution Alert. * * @param manager Entry point to SecurityManager. */ - public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations() - .getByResourceGroupWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", + public static void + dismissAnAggregatedIoTSecuritySolutionAlert(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts() + .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_List +### IotSecuritySolutionsAnalyticsAggregatedAlert_Get ```java /** - * Samples for CustomAssessmentAutomations List. + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ -public final class CustomAssessmentAutomationsListSamples { +public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json */ /** - * Sample code: List Custom Assessment Automations in a subscription. + * 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 - listCustomAssessmentAutomationsInASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); + getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts() + .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_ListByResourceGroup +### IotSecuritySolutionsAnalyticsAggregatedAlert_List ```java /** - * Samples for CustomAssessmentAutomations ListByResourceGroup. + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ -public final class CustomAssessmentAutomationsListByResourceGroupSamples { +public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json */ /** - * Sample code: List Custom Assessment Automations in a subscription and a resource group. + * Sample code: Get the aggregated alert list of yours IoT Security solution. * * @param manager Entry point to SecurityManager. */ - public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( + public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts() + .list("MyGroup", "default", null, com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_Create +### IotSecuritySolutionsAnalyticsRecommendation_Get ```java /** - * Samples for CustomEntityStoreAssignments Create. + * Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ -public final class CustomEntityStoreAssignmentsCreateSamples { +public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json */ /** - * Sample code: Create a custom entity store assignment. + * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. * * @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(); + public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsRecommendations() + .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_Delete +### IotSecuritySolutionsAnalyticsRecommendation_List ```java /** - * Samples for CustomEntityStoreAssignments Delete. + * Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ -public final class CustomEntityStoreAssignmentsDeleteSamples { +public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json */ /** - * Sample code: Delete a custom entity store assignment. + * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments() - .deleteByResourceGroupWithResponse("TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", - com.azure.core.util.Context.NONE); + public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsRecommendations() + .list("IoTEdgeResources", "default", null, com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_GetByResourceGroup +### 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 CustomEntityStoreAssignments GetByResourceGroup. + * Samples for JitNetworkAccessPolicies CreateOrUpdate. */ -public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { +public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * CreateJitNetworkAccessPolicy_example.json */ /** - * Sample code: Get a custom entity store assignment. + * Sample code: Create JIT network access policy. * * @param manager Entry point to SecurityManager. */ - public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments() - .getByResourceGroupWithResponse("TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", - com.azure.core.util.Context.NONE); + public static void 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(); } } ``` -### CustomEntityStoreAssignments_List +### JitNetworkAccessPolicies_Delete ```java /** - * Samples for CustomEntityStoreAssignments List. + * Samples for JitNetworkAccessPolicies Delete. */ -public final class CustomEntityStoreAssignmentsListSamples { +public final class JitNetworkAccessPoliciesDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * DeleteJitNetworkAccessPolicy_example.json */ /** - * Sample code: List custom entity store assignments in a subscription. + * Sample code: Delete a JIT network access policy. * * @param manager Entry point to SecurityManager. */ - public static void - listCustomEntityStoreAssignmentsInASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); + public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .deleteWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_ListByResourceGroup +### JitNetworkAccessPolicies_Get ```java /** - * Samples for CustomEntityStoreAssignments ListByResourceGroup. + * Samples for JitNetworkAccessPolicies Get. */ -public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { +public final class JitNetworkAccessPoliciesGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ - * CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPolicy_example.json */ /** - * Sample code: List custom entity store assignments in a subscription and a resource group. + * Sample code: Get JIT network access policy. * * @param manager Entry point to SecurityManager. */ - public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .getWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); } } ``` -### CustomRecommendations_CreateOrUpdate +### JitNetworkAccessPolicies_Initiate ```java -import com.azure.resourcemanager.security.models.RecommendationSupportedClouds; -import com.azure.resourcemanager.security.models.SecurityIssue; -import com.azure.resourcemanager.security.models.SeverityEnum; +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 CustomRecommendations CreateOrUpdate. + * Samples for JitNetworkAccessPolicies Initiate. */ -public final class CustomRecommendationsCreateOrUpdateSamples { +public final class JitNetworkAccessPoliciesInitiateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * PutBySecurityConnectorCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * InitiateJitNetworkAccessPolicy_example.json */ /** - * Sample code: Create or update custom recommendation over security connector scope. + * Sample code: Initiate an action on a JIT network access policy. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateCustomRecommendationOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .define("33e7cc6e-a139-4723-a0e5-76993aee0771") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") - .withQuery( - "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") - .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) - .withSeverity(SeverityEnum.MEDIUM) - .withSecurityIssue(SecurityIssue.VULNERABILITY) - .withDisplayName("Password Policy") - .withDescription("organization passwords policy") - .withRemediationDescription("Change password policy to...") - .create(); + 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"), com.azure.core.util.Context.NONE); } +} +``` +### JitNetworkAccessPolicies_List + +```java +/** + * Samples for JitNetworkAccessPolicies List. + */ +public final class JitNetworkAccessPoliciesListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * PutBySubscriptionCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesSubscription_example.json */ /** - * Sample code: Create or update custom recommendation over subscription scope. + * Sample code: Get JIT network access policies on a subscription. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateCustomRecommendationOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .define("33e7cc6e-a139-4723-a0e5-76993aee0771") - .withExistingScope("subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b") - .withQuery( - "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") - .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) - .withSeverity(SeverityEnum.MEDIUM) - .withSecurityIssue(SecurityIssue.VULNERABILITY) - .withDisplayName("Password Policy") - .withDescription("organization passwords policy") - .withRemediationDescription("Change password policy to...") - .create(); + public static void + getJITNetworkAccessPoliciesOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); } +} +``` +### JitNetworkAccessPolicies_ListByRegion + +```java +/** + * Samples for JitNetworkAccessPolicies ListByRegion. + */ +public final class JitNetworkAccessPoliciesListByRegionSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * PutByManagementGroupCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesSubscriptionLocation_example.json */ /** - * Sample code: Create or update custom recommendation over management group scope. + * Sample code: Get JIT network access policies on a subscription from a security data location. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateCustomRecommendationOverManagementGroupScope( + public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .define("33e7cc6e-a139-4723-a0e5-76993aee0771") - .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") - .withQuery( - "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") - .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) - .withSeverity(SeverityEnum.MEDIUM) - .withSecurityIssue(SecurityIssue.VULNERABILITY) - .withDisplayName("Password Policy") - .withDescription("organization passwords policy") - .withRemediationDescription("Change password policy to...") - .create(); + manager.jitNetworkAccessPolicies().listByRegion("westeurope", com.azure.core.util.Context.NONE); } } ``` -### CustomRecommendations_Delete +### JitNetworkAccessPolicies_ListByResourceGroup ```java /** - * Samples for CustomRecommendations Delete. + * Samples for JitNetworkAccessPolicies ListByResourceGroup. */ -public final class CustomRecommendationsDeleteSamples { +public final class JitNetworkAccessPoliciesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * DeleteBySecurityConnectorCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesResourceGroup_example.json */ /** - * Sample code: Delete a custom recommendation over security connector scope. + * Sample code: Get JIT network access policies on a resource group. * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomRecommendationOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + public static void + getJITNetworkAccessPoliciesOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); } +} +``` + +### JitNetworkAccessPolicies_ListByResourceGroupAndRegion +```java +/** + * Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. + */ +public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * DeleteBySubscriptionCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesResourceGroupLocation_example.json */ /** - * Sample code: Delete a custom recommendation over subscription scope. + * 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 - deleteACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .deleteByResourceGroupWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .listByResourceGroupAndRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); } +} +``` + +### Pricings_Delete +```java +/** + * Samples for Pricings Delete. + */ +public final class PricingsDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * DeleteByManagementGroupCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * DeleteResourcePricing_example.json */ /** - * Sample code: Delete a custom recommendation over management group scope. + * Sample code: Delete a pricing on resource. * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomRecommendationOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .deleteByResourceGroupWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + public static void deleteAPricingOnResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "VirtualMachines", com.azure.core.util.Context.NONE); } } ``` -### CustomRecommendations_Get +### Pricings_Get ```java /** - * Samples for CustomRecommendations Get. + * Samples for Pricings Get. */ -public final class CustomRecommendationsGetSamples { +public final class PricingsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * GetByManagementGroupCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetResourcePricingByNameVirtualMachines_example.json */ /** - * Sample code: Get a custom recommendation over management group scope. + * Sample code: Get pricings on resource - VirtualMachines plan. * * @param manager Entry point to SecurityManager. */ public static void - getACustomRecommendationOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + getPricingsOnResourceVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "VirtualMachines", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * GetBySecurityConnectorCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameCloudPosture_example.json */ /** - * Sample code: Get a custom recommendation over security connector scope. + * Sample code: Get pricings on subscription - CloudPosture plan. * * @param manager Entry point to SecurityManager. */ public static void - getACustomRecommendationOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + getPricingsOnSubscriptionCloudPosturePlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * GetBySubscriptionCustomRecommendation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameDns_example.json */ /** - * Sample code: Get a custom recommendation over subscription scope. + * Sample code: Get pricings on subscription - Dns plan. * * @param manager Entry point to SecurityManager. */ - public static void - getACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + public static void getPricingsOnSubscriptionDnsPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", + com.azure.core.util.Context.NONE); } -} -``` - -### CustomRecommendations_List -```java -/** - * Samples for CustomRecommendations List. - */ -public final class CustomRecommendationsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * ListByManagementGroupCustomRecommendations_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameContainers_example.json */ /** - * Sample code: List custom recommendations by management group scope. + * Sample code: Get pricings on subscription - Containers plan. * * @param manager Entry point to SecurityManager. */ public static void - listCustomRecommendationsByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + getPricingsOnSubscriptionContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * ListBySubscriptionCustomRecommendations_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameStorageAccounts_example.json */ /** - * Sample code: List custom recommendations by subscription scope. + * Sample code: Get pricings on subscription - StorageAccounts plan. * * @param manager Entry point to SecurityManager. */ public static void - listCustomRecommendationsBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + getPricingsOnSubscriptionStorageAccountsPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/ - * ListBySecurityConnectorCustomRecommendations_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameVirtualMachines_example.json */ /** - * Sample code: List custom recommendations by security connector scope. + * Sample code: Get pricings on subscription - VirtualMachines plan. * * @param manager Entry point to SecurityManager. */ public static void - listCustomRecommendationsBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.customRecommendations() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + getPricingsOnSubscriptionVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", com.azure.core.util.Context.NONE); } } ``` -### DefenderForStorage_CancelMalwareScan +### Pricings_List ```java -import com.azure.resourcemanager.security.models.SettingName; - /** - * Samples for DefenderForStorage CancelMalwareScan. + * Samples for Pricings List. */ -public final class DefenderForStorageCancelMalwareScanSamples { +public final class PricingsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/examples/DefenderForStorage - * /CancelMalwareScan_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * ListPricingsWithPlanFilter_example.json */ /** - * Sample code: Cancel a Defender for Storage malware scan for the specified storage resource. + * Sample code: Get pricings on subscription with plans filter. * * @param manager Entry point to SecurityManager. */ - public static void cancelADefenderForStorageMalwareScanForTheSpecifiedStorageResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.defenderForStorages() - .cancelMalwareScanWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - SettingName.CURRENT, "latest", com.azure.core.util.Context.NONE); - } -} -``` - -### DefenderForStorage_Create - -```java -import com.azure.resourcemanager.security.models.DefenderForStorageSettingProperties; -import com.azure.resourcemanager.security.models.MalwareScanningProperties; -import com.azure.resourcemanager.security.models.OnUploadProperties; -import com.azure.resourcemanager.security.models.SensitiveDataDiscoveryProperties; -import com.azure.resourcemanager.security.models.SettingName; - -/** - * Samples for DefenderForStorage Create. - */ -public final class DefenderForStorageCreateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/examples/DefenderForStorage - * /PutDefenderForStorageSettings_example.json - */ - /** - * Sample code: Creates or updates the Defender for Storage settings on a specified resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void createsOrUpdatesTheDefenderForStorageSettingsOnASpecifiedResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.defenderForStorages() - .define(SettingName.CURRENT) - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") - .withProperties(new DefenderForStorageSettingProperties().withIsEnabled(true) - .withMalwareScanning(new MalwareScanningProperties() - .withOnUpload(new OnUploadProperties().withIsEnabled(true).withCapGBPerMonth(-1)) - .withScanResultsEventGridTopicResourceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic")) - .withSensitiveDataDiscovery(new SensitiveDataDiscoveryProperties().withIsEnabled(true)) - .withOverrideSubscriptionLevelSettings(true)) - .create(); + public static void + getPricingsOnSubscriptionWithPlansFilter(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "name in (VirtualMachines,KeyVaults)", com.azure.core.util.Context.NONE); } -} -``` - -### DefenderForStorage_Get -```java -import com.azure.resourcemanager.security.models.SettingName; - -/** - * Samples for DefenderForStorage Get. - */ -public final class DefenderForStorageGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/examples/DefenderForStorage - * /GetDefenderForStorageSettings_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * ListPricings_example.json */ /** - * Sample code: Gets the Defender for Storage settings for the specified resource. + * Sample code: Get pricings on subscription. * * @param manager Entry point to SecurityManager. */ - public static void getsTheDefenderForStorageSettingsForTheSpecifiedResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.defenderForStorages() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - SettingName.CURRENT, com.azure.core.util.Context.NONE); + public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", null, + com.azure.core.util.Context.NONE); } -} -``` - -### DefenderForStorage_GetMalwareScan - -```java -import com.azure.resourcemanager.security.models.SettingName; -/** - * Samples for DefenderForStorage GetMalwareScan. - */ -public final class DefenderForStorageGetMalwareScanSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/examples/DefenderForStorage - * /GetMalwareScan_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * ListResourcePricings_example.json */ /** - * Sample code: Gets the Defender for Storage malware scan for the specified storage resource. + * Sample code: Get pricings on resource. * * @param manager Entry point to SecurityManager. */ - public static void getsTheDefenderForStorageMalwareScanForTheSpecifiedStorageResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.defenderForStorages() - .getMalwareScanWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - SettingName.CURRENT, "latest", com.azure.core.util.Context.NONE); + public static void getPricingsOnResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .listWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + null, com.azure.core.util.Context.NONE); } } ``` -### DefenderForStorage_StartMalwareScan +### Pricings_Update ```java -import com.azure.resourcemanager.security.models.SettingName; +import com.azure.resourcemanager.security.fluent.models.PricingInner; +import com.azure.resourcemanager.security.models.Enforce; +import com.azure.resourcemanager.security.models.PricingTier; /** - * Samples for DefenderForStorage StartMalwareScan. + * Samples for Pricings Update. */ -public final class DefenderForStorageStartMalwareScanSamples { +public final class PricingsUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/examples/DefenderForStorage - * /StartMalwareScan_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutPricingByName_example.json */ /** - * Sample code: Initiate a Defender for Storage malware scan for the specified storage account. + * Sample code: Update pricing on subscription (example for CloudPosture plan). * * @param manager Entry point to SecurityManager. */ - public static void initiateADefenderForStorageMalwareScanForTheSpecifiedStorageAccount( + public static void updatePricingOnSubscriptionExampleForCloudPosturePlan( com.azure.resourcemanager.security.SecurityManager manager) { - manager.defenderForStorages() - .startMalwareScanWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - SettingName.CURRENT, com.azure.core.util.Context.NONE); + manager.pricings() + .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); } -} -``` - -### DevOpsConfigurations_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.Authorization; -import com.azure.resourcemanager.security.models.AutoDiscovery; -import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; -import java.util.Arrays; -/** - * Samples for DevOpsConfigurations CreateOrUpdate. - */ -public final class DevOpsConfigurationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutPricingByNamePartialSuccess_example.json */ /** - * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentAndFuture. + * Sample code: Update pricing on subscription (example for CloudPosture plan) - partial success. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture( + public static void updatePricingOnSubscriptionExampleForCloudPosturePlanPartialSuccess( com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations() - .createOrUpdate("myRg", "mySecurityConnectorName", - new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() - .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) - .withAutoDiscovery(AutoDiscovery.ENABLED)), - com.azure.core.util.Context.NONE); + manager.pricings() + .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentOnly_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutPricingVMsByName_example.json */ /** - * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentOnly. + * Sample code: Update pricing on subscription (example for VirtualMachines plan). * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateDevOpsConfigurationsOnboardCurrentOnly( + public static void updatePricingOnSubscriptionExampleForVirtualMachinesPlan( com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations() - .createOrUpdate("myRg", "mySecurityConnectorName", - new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() - .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) - .withAutoDiscovery(AutoDiscovery.DISABLED)), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardSelected_example.json - */ - /** - * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardSelected. - * - * @param manager Entry point to SecurityManager. - */ - public static void - createOrUpdateDevOpsConfigurationsOnboardSelected(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations() - .createOrUpdate("myRg", "mySecurityConnectorName", - new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() - .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) - .withAutoDiscovery(AutoDiscovery.DISABLED) - .withTopLevelInventoryList(Arrays.asList("org1", "org2"))), - com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsConfigurations_Delete - -```java -/** - * Samples for DevOpsConfigurations Delete. - */ -public final class DevOpsConfigurationsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/DeleteDevOpsConfigurations_example.json - */ - /** - * Sample code: Delete_DevOpsConfigurations. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations().delete("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsConfigurations_Get - -```java -/** - * Samples for DevOpsConfigurations Get. - */ -public final class DevOpsConfigurationsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetDevOpsConfigurationsWithCapabilities_example.json - */ - /** - * Sample code: Get_DevOpsConfigurations_WithCapabilities. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getDevOpsConfigurationsWithCapabilities(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations() - .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetDevOpsConfigurations_example.json - */ - /** - * Sample code: Get_DevOpsConfigurations. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations() - .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsConfigurations_List - -```java -/** - * Samples for DevOpsConfigurations List. - */ -public final class DevOpsConfigurationsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListDevOpsConfigurations_example.json - */ - /** - * Sample code: List_DevOpsConfigurations. - * - * @param manager Entry point to SecurityManager. - */ - public static void listDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsConfigurations_Update - -```java -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.AutoDiscovery; -import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; - -/** - * Samples for DevOpsConfigurations Update. - */ -public final class DevOpsConfigurationsUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/UpdateDevOpsConfigurations_example.json - */ - /** - * Sample code: Update_DevOpsConfigurations. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsConfigurations() - .update("myRg", "mySecurityConnectorName", - new DevOpsConfigurationInner() - .withProperties(new DevOpsConfigurationProperties().withAutoDiscovery(AutoDiscovery.ENABLED)), - com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsOperationResults_Get - -```java -/** - * Samples for DevOpsOperationResults Get. - */ -public final class DevOpsOperationResultsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json - */ - /** - * Sample code: Get_DevOpsOperationResults_Failed. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDevOpsOperationResultsFailed(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsOperationResults() - .getWithResponse("myRg", "mySecurityConnectorName", "8d4caace-e7b3-4b3e-af99-73f76829ebcf", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json - */ - /** - * Sample code: Get_DevOpsOperationResults_Succeeded. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDevOpsOperationResultsSucceeded(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsOperationResults() - .getWithResponse("myRg", "mySecurityConnectorName", "4e826cf1-5c36-4808-a7d2-fb4f5170978b", + manager.pricings() + .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", + new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P2").withEnforce(Enforce.TRUE), com.azure.core.util.Context.NONE); } -} -``` - -### DevOpsPolicies_Get - -```java -/** - * Samples for DevOpsPolicies Get. - */ -public final class DevOpsPoliciesGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetDevOpsPolicies_example.json - */ - /** - * Sample code: Get_DevOpsPolicies. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDevOpsPolicies(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsPolicies() - .getWithResponse("myRg", "mySecurityConnectorName", "myDevOpsPolicy", com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsPolicies_List - -```java -/** - * Samples for DevOpsPolicies List. - */ -public final class DevOpsPoliciesListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListDevOpsPolicies_example.json - */ - /** - * Sample code: List_DevOpsPolicies. - * - * @param manager Entry point to SecurityManager. - */ - public static void listDevOpsPolicies(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsPolicies().list("myRg", "mySecurityConnectorName", null, com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsPolicyAssignments_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.DescendantBehavior; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignmentProperties; -import com.azure.resourcemanager.security.models.DevOpsPolicyDescriptor; -import com.azure.resourcemanager.security.models.DevOpsPolicyType; - -/** - * Samples for DevOpsPolicyAssignments CreateOrUpdate. - */ -public final class DevOpsPolicyAssignmentsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/CreateOrUpdateDevOpsPolicyAssignments_example.json - */ - /** - * Sample code: CreateOrUpdate_DevOpsPolicyAssignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void - createOrUpdateDevOpsPolicyAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsPolicyAssignments() - .define("5ec87f43-62d8-437b-8f46-4c8d4032cf6d") - .withExistingSecurityConnector("myRg", "mySecurityConnectorName") - .withProperties(new DevOpsPolicyAssignmentProperties().withResourceId( - "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourcegroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/Contoso") - .withDescendantBehavior(DescendantBehavior.OVERRIDE) - .withPolicy(new DevOpsPolicyDescriptor().withPolicyName("myDevOpsPolicy") - .withPolicyId("00000000-0000-0000-0000-000000000000") - .withPolicyVersion("1.0") - .withPolicyType(DevOpsPolicyType.PIPELINE))) - .create(); - } -} -``` - -### DevOpsPolicyAssignments_Delete - -```java -/** - * Samples for DevOpsPolicyAssignments Delete. - */ -public final class DevOpsPolicyAssignmentsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/DeleteDevOpsPolicyAssignments_example.json - */ - /** - * Sample code: Delete_DevOpsPolicyAssignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteDevOpsPolicyAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsPolicyAssignments() - .delete("myRg", "mySecurityConnectorName", "5ec87f43-62d8-437b-8f46-4c8d4032cf6d", - com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsPolicyAssignments_Get - -```java -/** - * Samples for DevOpsPolicyAssignments Get. - */ -public final class DevOpsPolicyAssignmentsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetDevOpsPolicyAssignments_example.json - */ - /** - * Sample code: Get_DevOpsPolicyAssignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDevOpsPolicyAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsPolicyAssignments() - .getWithResponse("myRg", "mySecurityConnectorName", "5ec87f43-62d8-437b-8f46-4c8d4032cf6d", - com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsPolicyAssignments_List - -```java -/** - * Samples for DevOpsPolicyAssignments List. - */ -public final class DevOpsPolicyAssignmentsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListDevOpsPolicyAssignments_example.json - */ - /** - * Sample code: List_DevOpsPolicyAssignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void listDevOpsPolicyAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.devOpsPolicyAssignments() - .list("myRg", "mySecurityConnectorName", null, null, com.azure.core.util.Context.NONE); - } -} -``` - -### DevOpsPolicyAssignments_Update - -```java -import com.azure.resourcemanager.security.models.DescendantBehavior; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignment; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignmentProperties; -import com.azure.resourcemanager.security.models.DevOpsPolicyDescriptor; -import com.azure.resourcemanager.security.models.DevOpsPolicyType; - -/** - * Samples for DevOpsPolicyAssignments Update. - */ -public final class DevOpsPolicyAssignmentsUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/UpdateDevOpsPolicyAssignments_example.json - */ - /** - * Sample code: Update_DevOpsPolicyAssignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateDevOpsPolicyAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - DevOpsPolicyAssignment resource = manager.devOpsPolicyAssignments() - .getWithResponse("myRg", "mySecurityConnectorName", "5ec87f43-62d8-437b-8f46-4c8d4032cf6d", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new DevOpsPolicyAssignmentProperties().withResourceId( - "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourcegroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/Contoso") - .withDescendantBehavior(DescendantBehavior.OVERRIDE) - .withPolicy(new DevOpsPolicyDescriptor().withPolicyName("myDevOpsPolicy") - .withPolicyId("00000000-0000-0000-0000-000000000000") - .withPolicyVersion("1.0") - .withPolicyType(DevOpsPolicyType.PIPELINE))) - .apply(); - } -} -``` - -### 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 -/** - * 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() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", com.azure.core.util.Context.NONE); - } -} -``` - -### DeviceSecurityGroups_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### DeviceSecurityGroups_List - -```java -/** - * 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", - com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredSecuritySolutions_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredSecuritySolutions_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredSecuritySolutions_ListByHomeRegion - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### ExternalSecuritySolutions_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### ExternalSecuritySolutions_List - -```java -/** - * Samples for ExternalSecuritySolutions List. - */ -public final class ExternalSecuritySolutionsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ - * GetExternalSecuritySolutionsSubscription_example.json - */ - /** - * Sample code: Get external security solutions on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getExternalSecuritySolutionsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); - } -} -``` - -### ExternalSecuritySolutions_ListByHomeRegion - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### GitHubOwners_Get - -```java -/** - * Samples for GitHubOwners Get. - */ -public final class GitHubOwnersGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetGitHubOwners_example.json - */ - /** - * Sample code: Get_GitHubOwners. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitHubOwners() - .getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); - } -} -``` - -### GitHubOwners_List - -```java -/** - * Samples for GitHubOwners List. - */ -public final class GitHubOwnersListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListGitHubOwners_example.json - */ - /** - * Sample code: List_GitHubOwners. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitHubOwners().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### GitHubOwners_ListAvailable - -```java -/** - * Samples for GitHubOwners ListAvailable. - */ -public final class GitHubOwnersListAvailableSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListAvailableGitHubOwners_example.json - */ - /** - * Sample code: ListAvailable_GitHubOwners. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAvailableGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitHubOwners() - .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### GitHubRepos_Get - -```java -/** - * Samples for GitHubRepos Get. - */ -public final class GitHubReposGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetGitHubRepos_example.json - */ - /** - * Sample code: Get_GitHubRepos. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitHubRepos() - .getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", - com.azure.core.util.Context.NONE); - } -} -``` - -### GitHubRepos_List - -```java -/** - * Samples for GitHubRepos List. - */ -public final class GitHubReposListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListGitHubRepos_example.json - */ - /** - * Sample code: List_GitHubRepos. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitHubRepos() - .list("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); - } -} -``` - -### GitLabGroups_Get - -```java -/** - * Samples for GitLabGroups Get. - */ -public final class GitLabGroupsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetGitLabGroups_example.json - */ - /** - * Sample code: Get_GitLabGroups. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitLabGroups() - .getWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", - com.azure.core.util.Context.NONE); - } -} -``` - -### GitLabGroups_List - -```java -/** - * Samples for GitLabGroups List. - */ -public final class GitLabGroupsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListGitLabGroups_example.json - */ - /** - * Sample code: List_GitLabGroups. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitLabGroups().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### GitLabGroups_ListAvailable - -```java -/** - * Samples for GitLabGroups ListAvailable. - */ -public final class GitLabGroupsListAvailableSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListAvailableGitLabGroups_example.json - */ - /** - * Sample code: ListAvailable_GitLabGroups. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAvailableGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitLabGroups() - .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### GitLabProjects_Get - -```java -/** - * Samples for GitLabProjects Get. - */ -public final class GitLabProjectsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/GetGitLabProjects_example.json - */ - /** - * Sample code: Get_GitLabProjects. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitLabProjects() - .getWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", "myGitLabProject", - com.azure.core.util.Context.NONE); - } -} -``` - -### GitLabProjects_List - -```java -/** - * Samples for GitLabProjects List. - */ -public final class GitLabProjectsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListGitLabProjects_example.json - */ - /** - * Sample code: List_GitLabProjects. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitLabProjects() - .list("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### GitLabSubgroups_List - -```java -/** - * Samples for GitLabSubgroups List. - */ -public final class GitLabSubgroupsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-05-15-preview/examples/ - * SecurityConnectorsDevOps/ListGitLabSubgroups_example.json - */ - /** - * Sample code: List_GitLabSubgroups. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGitLabSubgroups(com.azure.resourcemanager.security.SecurityManager manager) { - manager.gitLabSubgroups() - .listWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceAssignments_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; - -/** - * Samples for GovernanceAssignments CreateOrUpdate. - */ -public final class GovernanceAssignmentsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ - * GovernanceAssignments/PutGovernanceAssignment_example.json - */ - /** - * Sample code: Create Governance assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void createGovernanceAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceAssignments() - .define("6634ff9f-127b-4bf2-8e6e-b1737f5e789c") - .withExistingAssessment( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd") - .withOwner("user@contoso.com") - .withRemediationDueDate(OffsetDateTime.parse("2022-01-07T13:00:00.0000000Z")) - .withRemediationEta(new RemediationEta().withEta(OffsetDateTime.parse("2022-01-08T13:00:00.0000000Z")) - .withJustification("Justification of ETA")) - .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification().withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withAdditionalData(new GovernanceAssignmentAdditionalData().withTicketNumber(123123) - .withTicketLink("https://snow.com") - .withTicketStatus("Active")) - .create(); - } -} -``` - -### GovernanceAssignments_Delete - -```java -/** - * Samples for GovernanceAssignments Delete. - */ -public final class GovernanceAssignmentsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ - * GovernanceAssignments/DeleteGovernanceAssignment_example.json - */ - /** - * Sample code: Delete security assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceAssignments() - .deleteWithResponse( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceAssignments_Get - -```java -/** - * Samples for GovernanceAssignments Get. - */ -public final class GovernanceAssignmentsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ - * GovernanceAssignments/GetGovernanceAssignment_example.json - */ - /** - * Sample code: Get governanceAssignment by specific governanceAssignmentKey. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceAssignmentBySpecificGovernanceAssignmentKey( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceAssignments() - .getWithResponse( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceAssignments_List - -```java -/** - * Samples for GovernanceAssignments List. - */ -public final class GovernanceAssignmentsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ - * GovernanceAssignments/ListGovernanceAssignments_example.json - */ - /** - * Sample code: List governance assignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceAssignments() - .list("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceRules_CreateOrUpdate - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.Arrays; - -/** - * Samples for GovernanceRules CreateOrUpdate. - */ -public final class GovernanceRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * PutManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Create or update governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager.governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") - .withDisplayName("Management group rule") - .withDescription("A rule for a management group") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")) - .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, SerializerEncoding.JSON))) - .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification().withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)) - .create(); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * PutSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Create or update governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager.governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") - .withDisplayName("GCP Admin's rule") - .withDescription("A rule on critical GCP recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, SerializerEncoding.JSON))) - .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification().withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)) - .create(); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * PutGovernanceRule_example.json - */ - /** - * Sample code: Create or update governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager.governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .withDisplayName("Admin's rule") - .withDescription("A rule for critical recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, SerializerEncoding.JSON))) - .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification().withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .create(); - } -} -``` - -### GovernanceRules_Delete - -```java -/** - * Samples for GovernanceRules Delete. - */ -public final class GovernanceRulesDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * DeleteManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Delete a Governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteAGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .delete("providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * DeleteGovernanceRule_example.json - */ - /** - * Sample code: Delete a Governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteAGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .delete("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * DeleteSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Delete a Governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteAGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .delete( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceRules_Execute - -```java - -/** - * Samples for GovernanceRules Execute. - */ -public final class GovernanceRulesExecuteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * PostSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Execute governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - executeGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .execute( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * PostGovernanceRule_example.json - */ - /** - * Sample code: Execute Governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - executeGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .execute("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * PostManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Execute governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - executeGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .execute("providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceRules_Get - -```java -/** - * Samples for GovernanceRules Get. - */ -public final class GovernanceRulesGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * GetManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Get a governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getAGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * GetGovernanceRule_example.json - */ - /** - * Sample code: Get a governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getAGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * GetSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Get a governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getAGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceRules_List - -```java -/** - * Samples for GovernanceRules List. - */ -public final class GovernanceRulesListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * ListBySubscriptionGovernanceRules_example.json - */ - /** - * Sample code: List governance rules by subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listGovernanceRulesBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * ListBySecurityConnectorGovernanceRules_example.json - */ - /** - * Sample code: List governance rules by security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listGovernanceRulesBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * ListByManagementGroupGovernanceRules_example.json - */ - /** - * Sample code: List governance rules by management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listGovernanceRulesByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); - } -} -``` - -### GovernanceRules_OperationResults - -```java -/** - * Samples for GovernanceRules OperationResults. - */ -public final class GovernanceRulesOperationResultsSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * GetManagementGroupGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get governance rules long run operation result over management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceRulesLongRunOperationResultOverManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .operationResultsWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * GetSecurityConnectorGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get governance rules long run operation result over security connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .operationResultsWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ - * GetGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get governance rules long run operation result over subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceRulesLongRunOperationResultOverSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules() - .operationResultsWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); - } -} -``` - -### HealthReports_Get - -```java -/** - * Samples for HealthReports Get. - */ -public final class HealthReportsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ - * GetHealthReports_example.json - */ - /** - * Sample code: Get health report of resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { - manager.healthReports() - .getWithResponse( - "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", - "909c629a-bf39-4521-8e4f-10b443a0bc02", com.azure.core.util.Context.NONE); - } -} -``` - -### HealthReports_List - -```java -/** - * Samples for HealthReports List. - */ -public final class HealthReportsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ - * ListHealthReports_example.json - */ - /** - * Sample code: List health reports. - * - * @param manager Entry point to SecurityManager. - */ - public static void listHealthReports(com.azure.resourcemanager.security.SecurityManager manager) { - manager.healthReports() - .list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", com.azure.core.util.Context.NONE); - } -} -``` - -### InformationProtectionPolicies_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.InformationProtectionKeyword; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -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(InformationProtectionPolicyName.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(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### InformationProtectionPolicies_Get - -```java -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -/** - * 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", - InformationProtectionPolicyName.CUSTOM, com.azure.core.util.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", - InformationProtectionPolicyName.EFFECTIVE, com.azure.core.util.Context.NONE); - } -} -``` - -### InformationProtectionPolicies_List - -```java -/** - * 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", - com.azure.core.util.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(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### IotSecuritySolution_Delete - -```java -/** - * 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() - .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolution_GetByResourceGroup - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolution_List - -```java -/** - * 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, com.azure.core.util.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\")", - com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolution_ListByResourceGroup - -```java -/** - * 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\")", - com.azure.core.util.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, com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolution_Update - -```java -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", com.azure.core.util.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(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### IotSecuritySolutionAnalytics_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolutionAnalytics_List - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss - -```java -/** - * 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", - com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolutionsAnalyticsAggregatedAlert_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolutionsAnalyticsAggregatedAlert_List - -```java -/** - * 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, com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolutionsAnalyticsRecommendation_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### IotSecuritySolutionsAnalyticsRecommendation_List - -```java -/** - * 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, com.azure.core.util.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 -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### JitNetworkAccessPolicies_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### JitNetworkAccessPolicies_Initiate - -```java -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"), com.azure.core.util.Context.NONE); - } -} -``` - -### JitNetworkAccessPolicies_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### JitNetworkAccessPolicies_ListByRegion - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### JitNetworkAccessPolicies_ListByResourceGroup - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### JitNetworkAccessPolicies_ListByResourceGroupAndRegion - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### Locations_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### Locations_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### MdeOnboardings_Get - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### MdeOnboardings_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### Operations_List - -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/examples/Operations/ - * ListOperations_example.json - */ - /** - * Sample code: List the operations for the Microsoft.Security (Microsoft Defender for Cloud) resource provider. - * - * @param manager Entry point to SecurityManager. - */ - public static void listTheOperationsForTheMicrosoftSecurityMicrosoftDefenderForCloudResourceProvider( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### Pricings_Delete - -```java -/** - * Samples for Pricings Delete. - */ -public final class PricingsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * DeleteResourcePricing_example.json - */ - /** - * Sample code: Delete a pricing on resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAPricingOnResource(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", - "VirtualMachines", com.azure.core.util.Context.NONE); - } -} -``` - -### Pricings_Get - -```java -/** - * Samples for Pricings Get. - */ -public final class PricingsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * GetResourcePricingByNameVirtualMachines_example.json - */ - /** - * Sample code: Get pricings on resource - VirtualMachines plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getPricingsOnResourceVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", - "VirtualMachines", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * GetPricingByNameCloudPosture_example.json - */ - /** - * Sample code: Get pricings on subscription - CloudPosture plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getPricingsOnSubscriptionCloudPosturePlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * GetPricingByNameDns_example.json - */ - /** - * Sample code: Get pricings on subscription - Dns plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscriptionDnsPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * GetPricingByNameContainers_example.json - */ - /** - * Sample code: Get pricings on subscription - Containers plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getPricingsOnSubscriptionContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * GetPricingByNameStorageAccounts_example.json - */ - /** - * Sample code: Get pricings on subscription - StorageAccounts plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getPricingsOnSubscriptionStorageAccountsPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * GetPricingByNameVirtualMachines_example.json - */ - /** - * Sample code: Get pricings on subscription - VirtualMachines plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getPricingsOnSubscriptionVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", - com.azure.core.util.Context.NONE); - } -} -``` - -### Pricings_List - -```java -/** - * Samples for Pricings List. - */ -public final class PricingsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * ListPricingsWithPlanFilter_example.json - */ - /** - * Sample code: Get pricings on subscription with plans filter. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getPricingsOnSubscriptionWithPlansFilter(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "name in (VirtualMachines,KeyVaults)", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-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("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", null, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * ListResourcePricings_example.json - */ - /** - * Sample code: Get pricings on resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnResource(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .listWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", - null, com.azure.core.util.Context.NONE); - } -} -``` - -### Pricings_Update - -```java -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Enforce; -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/2024-01-01/examples/Pricings/ - * PutPricingByName_example.json - */ - /** - * Sample code: Update pricing on subscription (example for CloudPosture plan). - * - * @param manager Entry point to SecurityManager. - */ - public static void updatePricingOnSubscriptionExampleForCloudPosturePlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", - new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * PutPricingByNamePartialSuccess_example.json - */ - /** - * Sample code: Update pricing on subscription (example for CloudPosture plan) - partial success. - * - * @param manager Entry point to SecurityManager. - */ - public static void updatePricingOnSubscriptionExampleForCloudPosturePlanPartialSuccess( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", - new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * PutPricingVMsByName_example.json - */ - /** - * Sample code: Update pricing on subscription (example for VirtualMachines plan). - * - * @param manager Entry point to SecurityManager. - */ - public static void updatePricingOnSubscriptionExampleForVirtualMachinesPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", - new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P2").withEnforce(Enforce.TRUE), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ - * PutResourcePricingByNameVirtualMachines_example.json - */ - /** - * Sample code: Update pricing on resource (example for VirtualMachines plan). - * - * @param manager Entry point to SecurityManager. - */ - public static void updatePricingOnResourceExampleForVirtualMachinesPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings() - .updateWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", - "virtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P1"), - com.azure.core.util.Context.NONE); - } -} -``` - -### RegulatoryComplianceAssessments_Get - -```java -/** - * 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", - com.azure.core.util.Context.NONE); - } -} -``` - -### RegulatoryComplianceAssessments_List - -```java -/** - * 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, com.azure.core.util.Context.NONE); - } -} -``` - -### RegulatoryComplianceControls_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### RegulatoryComplianceControls_List - -```java -/** - * 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, com.azure.core.util.Context.NONE); - } -} -``` - -### RegulatoryComplianceStandards_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### RegulatoryComplianceStandards_List - -```java -/** - * 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, com.azure.core.util.Context.NONE); - } -} -``` - -### SecureScoreControlDefinitions_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### SecureScoreControlDefinitions_ListBySubscription - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### SecureScoreControls_List - -```java - -/** - * 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, com.azure.core.util.Context.NONE); - } -} -``` - -### SecureScoreControls_ListBySecureScore - -```java -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, com.azure.core.util.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, com.azure.core.util.Context.NONE); - } -} -``` - -### SecureScores_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### SecureScores_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectorApplicationOperation_CreateOrUpdate - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.Arrays; - -/** - * Samples for SecurityConnectorApplicationOperation CreateOrUpdate. - */ -public final class SecurityConnectorApplicationOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * PutSecurityConnectorApplication_example.json - */ - /** - * Sample code: Create Application. - * - * @param manager Entry point to SecurityManager. - */ - public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager.securityConnectorApplicationOperations() - .createOrUpdateWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - new ApplicationInner().withDisplayName("GCP Admin's application") - .withDescription("An application on critical GCP recommendations") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", - Object.class, SerializerEncoding.JSON))), - com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectorApplicationOperation_Delete - -```java -/** - * Samples for SecurityConnectorApplicationOperation Delete. - */ -public final class SecurityConnectorApplicationOperationDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * DeleteSecurityConnectorApplication_example.json - */ - /** - * Sample code: Delete security Application. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorApplicationOperations() - .deleteWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectorApplicationOperation_Get - -```java -/** - * Samples for SecurityConnectorApplicationOperation Get. - */ -public final class SecurityConnectorApplicationOperationGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * GetSecurityConnectorApplication_example.json - */ - /** - * Sample code: Get security applications by specific applicationId. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getSecurityApplicationsBySpecificApplicationId(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorApplicationOperations() - .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectorApplications_List - -```java -/** - * Samples for SecurityConnectorApplications List. - */ -public final class SecurityConnectorApplicationsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ - * ListBySecurityConnectorApplications_example.json - */ - /** - * Sample code: List security applications by security connector level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityApplicationsBySecurityConnectorLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorApplications() - .list("gcpResourceGroup", "gcpconnector", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectors_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.AwsEnvironmentData; -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/2024-08-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") - .withEnvironmentName(CloudName.AWS) - .withOfferings(Arrays.asList( - new CspmMonitorAwsOffering().withNativeCloudConnection(new CspmMonitorAwsOfferingNativeCloudConnection() - .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData().withScanInterval(4L)) - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### SecurityConnectors_Delete - -```java -/** - * Samples for SecurityConnectors Delete. - */ -public final class SecurityConnectorsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-08-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() - .deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectors_GetByResourceGroup - -```java -/** - * Samples for SecurityConnectors GetByResourceGroup. - */ -public final class SecurityConnectorsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-08-01-preview/examples/SecurityConnectors - * /GetSecurityConnectorSingleResource_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", - com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectors_List - -```java -/** - * Samples for SecurityConnectors List. - */ -public final class SecurityConnectorsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-08-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(com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectors_ListByResourceGroup - -```java -/** - * Samples for SecurityConnectors ListByResourceGroup. - */ -public final class SecurityConnectorsListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2024-08-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", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityConnectors_Update - -```java -import com.azure.resourcemanager.security.models.AwsEnvironmentData; -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/2024-08-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", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf()) - .withHierarchyIdentifier("exampleHierarchyId") - .withEnvironmentName(CloudName.AWS) - .withOfferings(Arrays.asList( - new CspmMonitorAwsOffering().withNativeCloudConnection(new CspmMonitorAwsOfferingNativeCloudConnection() - .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### SecurityContacts_Create - -```java -import com.azure.resourcemanager.security.models.MinimalRiskLevel; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.NotificationsSourceAlert; -import com.azure.resourcemanager.security.models.NotificationsSourceAttackPath; -import com.azure.resourcemanager.security.models.SecurityContactName; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.SecurityContactRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; - -/** - * Samples for SecurityContacts Create. - */ -public final class SecurityContactsCreateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ - * CreateSecurityContact_example.json - */ - /** - * Sample code: Create security contact data. - * - * @param manager Entry point to SecurityManager. - */ - public static void createSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts() - .define(SecurityContactName.DEFAULT) - .withEmails("john@contoso.com;jane@contoso.com") - .withPhone("(214)275-4038") - .withIsEnabled(true) - .withNotificationsSources( - Arrays.asList(new NotificationsSourceAttackPath().withMinimalRiskLevel(MinimalRiskLevel.CRITICAL), - new NotificationsSourceAlert().withMinimalSeverity(MinimalSeverity.MEDIUM))) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole().withState(State.fromString("On")) - .withRoles(Arrays.asList(SecurityContactRole.OWNER))) - .create(); - } -} -``` - -### SecurityContacts_Delete - -```java -import com.azure.resourcemanager.security.models.SecurityContactName; - -/** - * Samples for SecurityContacts Delete. - */ -public final class SecurityContactsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ - * DeleteSecurityContact_example.json - */ - /** - * Sample code: Deletes a security contact data. - * - * @param manager Entry point to SecurityManager. - */ - public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().deleteWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityContacts_Get - -```java -import com.azure.resourcemanager.security.models.SecurityContactName; - -/** - * Samples for SecurityContacts Get. - */ -public final class SecurityContactsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ - * GetSecurityContact_example.json - */ - /** - * Sample code: Get a security contact. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASecurityContact(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().getWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityContacts_List - -```java -/** - * Samples for SecurityContacts List. - */ -public final class SecurityContactsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ - * GetSecurityContactsSubscription_example.json - */ - /** - * Sample code: List security contact data. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().list(com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityOperators_CreateOrUpdate - -```java -/** - * Samples for SecurityOperators CreateOrUpdate. - */ -public final class SecurityOperatorsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ - * PutSecurityOperatorByName_example.json - */ - /** - * Sample code: Create a security operator on the given scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - createASecurityOperatorOnTheGivenScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityOperators() - .createOrUpdateWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", - com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityOperators_Delete - -```java -/** - * Samples for SecurityOperators Delete. - */ -public final class SecurityOperatorsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ - * DeleteSecurityOperatorByName_example.json - */ - /** - * Sample code: Delete SecurityOperator on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteSecurityOperatorOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityOperators() - .deleteByResourceGroupWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", - com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityOperators_Get - -```java -/** - * Samples for SecurityOperators Get. - */ -public final class SecurityOperatorsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ - * GetSecurityOperatorByName_example.json - */ - /** - * Sample code: Get a specific security operator by scope and securityOperatorName. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASpecificSecurityOperatorByScopeAndSecurityOperatorName( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityOperators() - .getWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityOperators_List - -```java -/** - * Samples for SecurityOperators List. - */ -public final class SecurityOperatorsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ - * ListSecurityOperators_example.json - */ - /** - * Sample code: List SecurityOperators. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityOperators(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityOperators().listWithResponse("CloudPosture", com.azure.core.util.Context.NONE); - } -} -``` - -### SecuritySolutions_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### SecuritySolutions_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### SecuritySolutionsReferenceData_List - -```java -/** - * 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(com.azure.core.util.Context.NONE); - } -} -``` - -### SecuritySolutionsReferenceData_ListByHomeRegion - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityStandards_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.PartialAssessmentProperties; -import com.azure.resourcemanager.security.models.StandardSupportedCloud; -import java.util.Arrays; - -/** - * Samples for SecurityStandards CreateOrUpdate. - */ -public final class SecurityStandardsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * PutBySubscriptionSecurityStandard_example.json - */ - /** - * Sample code: Create or update security standard over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateSecurityStandardOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") - .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .withDisplayName("Azure Test Security Standard 1") - .withDescription("description of Azure Test Security Standard 1") - .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), - new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) - .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) - .withPolicySetDefinitionId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Authorization/policySetDefinitions/patchorchestration-applicationversions") - .create(); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * PutBySecurityConnectorSecurityStandard_example.json - */ - /** - * Sample code: Create or update security standard over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateSecurityStandardOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") - .withDisplayName("Azure Test Security Standard 1") - .withDescription("description of Azure Test Security Standard 1") - .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), - new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) - .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) - .create(); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * PutByManagementGroupSecurityStandard_example.json - */ - /** - * Sample code: Create or update security standard over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateSecurityStandardOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") - .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") - .withDisplayName("Azure Test Security Standard 1") - .withDescription("description of Azure Test Security Standard 1") - .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), - new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) - .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) - .withPolicySetDefinitionId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Authorization/policySetDefinitions/patchorchestration-applicationversions") - .create(); - } -} -``` - -### SecurityStandards_Delete - -```java -/** - * Samples for SecurityStandards Delete. - */ -public final class SecurityStandardsDeleteSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * DeleteBySecurityConnectorSecurityStandard_example.json - */ - /** - * Sample code: Delete a security standard over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteASecurityStandardOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * DeleteByManagementGroupSecurityStandard_example.json - */ - /** - * Sample code: Delete a security standard over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteASecurityStandardOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .deleteByResourceGroupWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * DeleteBySubscriptionSecurityStandard_example.json - */ - /** - * Sample code: Delete a security standard over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteASecurityStandardOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .deleteByResourceGroupWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityStandards_Get - -```java -/** - * Samples for SecurityStandards Get. - */ -public final class SecurityStandardsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * GetBySecurityConnectorSecurityStandard_example.json - */ - /** - * Sample code: Get a security standard over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getASecurityStandardOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * GetByManagementGroupSecurityStandard_example.json - */ - /** - * Sample code: Get a security standard over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getASecurityStandardOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * GetBySubscriptionSecurityStandard_example.json - */ - /** - * Sample code: Get a security standard over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getASecurityStandardOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); - } -} -``` - -### SecurityStandards_List - -```java -/** - * Samples for SecurityStandards List. - */ -public final class SecurityStandardsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * ListByManagementGroupSecurityStandards_example.json - */ - /** - * Sample code: List security standards by management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listSecurityStandardsByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * ListBySubscriptionSecurityStandards_example.json - */ - /** - * Sample code: List security standards by subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listSecurityStandardsBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ - * ListBySecurityConnectorSecurityStandards_example.json - */ - /** - * Sample code: List security standards by security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void - listSecurityStandardsBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityStandards() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - com.azure.core.util.Context.NONE); - } -} -``` - -### SensitivitySettings_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; -import java.util.Arrays; -import java.util.UUID; - -/** - * Samples for SensitivitySettings CreateOrUpdate. - */ -public final class SensitivitySettingsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/ - * SensitivitySettings/PutSensitivitySettings_example.json - */ - /** - * Sample code: Update sensitivity settings. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { - manager.sensitivitySettings() - .createOrUpdateWithResponse( - new UpdateSensitivitySettingsRequest() - .withSensitiveInfoTypesIds(Arrays.asList(UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), - UUID.fromString("b452f22b-f87d-4f48-8490-ecf0873325b5"), - UUID.fromString("d59ee8b6-2618-404b-a5e7-aa377cd67543"))) - .withSensitivityThresholdLabelOrder(2.0F) - .withSensitivityThresholdLabelId(UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb")), - com.azure.core.util.Context.NONE); - } -} -``` - -### SensitivitySettings_Get - -```java -/** - * Samples for SensitivitySettings Get. - */ -public final class SensitivitySettingsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/ - * SensitivitySettings/GetSensitivitySettings_example.json - */ - /** - * Sample code: Get sensitivity settings. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { - manager.sensitivitySettings().getWithResponse(com.azure.core.util.Context.NONE); - } -} -``` - -### SensitivitySettings_List - -```java -/** - * Samples for SensitivitySettings List. - */ -public final class SensitivitySettingsListSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/ - * SensitivitySettings/GetSensitivitySettingsList_example.json - */ - /** - * Sample code: Get sensitivity settings list. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSensitivitySettingsList(com.azure.resourcemanager.security.SecurityManager manager) { - manager.sensitivitySettings().listWithResponse(com.azure.core.util.Context.NONE); - } -} -``` - -### ServerVulnerabilityAssessment_CreateOrUpdate - -```java -/** - * 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", - com.azure.core.util.Context.NONE); - } -} -``` - -### ServerVulnerabilityAssessment_Delete - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### ServerVulnerabilityAssessment_Get - -```java -/** - * 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", com.azure.core.util.Context.NONE); - } -} -``` - -### ServerVulnerabilityAssessment_ListByExtendedResource - -```java -/** - * 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", - com.azure.core.util.Context.NONE); - } -} -``` - -### ServerVulnerabilityAssessmentsSettings_CreateOrUpdate - -```java -import com.azure.resourcemanager.security.models.AzureServersSetting; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; - -/** - * Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate. - */ -public final class ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ - * ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json - */ - /** - * Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.serverVulnerabilityAssessmentsSettings() - .createOrUpdateWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, - new AzureServersSetting() - .withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM), - com.azure.core.util.Context.NONE); - } -} -``` - -### ServerVulnerabilityAssessmentsSettings_Delete - -```java -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; -/** - * Samples for ServerVulnerabilityAssessmentsSettings Delete. - */ -public final class ServerVulnerabilityAssessmentsSettingsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ - * ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutResourcePricingByNameVirtualMachines_example.json */ /** - * Sample code: Delete the server vulnerability assessments setting of the kind settingKind from the subscription. + * Sample code: Update pricing on resource (example for VirtualMachines plan). * * @param manager Entry point to SecurityManager. */ - public static void deleteTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindFromTheSubscription( + public static void updatePricingOnResourceExampleForVirtualMachinesPlan( com.azure.resourcemanager.security.SecurityManager manager) { - manager.serverVulnerabilityAssessmentsSettings() - .deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + manager.pricings() + .updateWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "virtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P1"), com.azure.core.util.Context.NONE); } } ``` -### ServerVulnerabilityAssessmentsSettings_Get +### SecureScoreControlDefinitions_List ```java -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; - /** - * Samples for ServerVulnerabilityAssessmentsSettings Get. + * Samples for SecureScoreControlDefinitions List. */ -public final class ServerVulnerabilityAssessmentsSettingsGetSamples { +public final class SecureScoreControlDefinitionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ - * ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json */ /** - * Sample code: Get the server vulnerability assessments setting of the kind settingKind that is set on the - * subscription. + * Sample code: List security controls definition. * * @param manager Entry point to SecurityManager. */ - public static void getTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindThatIsSetOnTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.serverVulnerabilityAssessmentsSettings() - .getWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, - com.azure.core.util.Context.NONE); + public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); } } ``` -### ServerVulnerabilityAssessmentsSettings_List +### SecureScoreControlDefinitions_ListBySubscription ```java /** - * Samples for ServerVulnerabilityAssessmentsSettings List. + * Samples for SecureScoreControlDefinitions ListBySubscription. */ -public final class ServerVulnerabilityAssessmentsSettingsListSamples { +public final class SecureScoreControlDefinitionsListBySubscriptionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ - * ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json */ /** - * Sample code: List the server vulnerability assessments settings set on the subscription. + * Sample code: List security controls definition by subscription. * * @param manager Entry point to SecurityManager. */ - public static void listTheServerVulnerabilityAssessmentsSettingsSetOnTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.serverVulnerabilityAssessmentsSettings().list(com.azure.core.util.Context.NONE); + public static void + listSecurityControlsDefinitionBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); } } ``` -### Settings_Get +### SecureScoreControls_List ```java -import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; /** - * Samples for Settings Get. + * Samples for SecureScoreControls List. */ -public final class SettingsGetSamples { +public final class SecureScoreControlsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example - * .json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScoreControls_example.json */ /** - * Sample code: Get a setting on subscription. + * Sample code: List all secure scores controls. * * @param manager Entry point to SecurityManager. */ - public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().getWithResponse(SettingNameAutoGenerated.WDATP, com.azure.core.util.Context.NONE); + public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().list(null, com.azure.core.util.Context.NONE); } } ``` -### Settings_List +### SecureScoreControls_ListBySecureScore ```java +import com.azure.resourcemanager.security.models.ExpandControlsEnum; + /** - * Samples for Settings List. + * Samples for SecureScoreControls ListBySecureScore. */ -public final class SettingsListSamples { +public final class SecureScoreControlsListBySecureScoreSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/ - * GetSettings_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScoreControlsForNameWithExpand_builtin_example.json */ /** - * Sample code: Get settings of subscription. + * 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 getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().list(com.azure.core.util.Context.NONE); + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls() + .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); } -} -``` - -### Settings_Update - -```java -import com.azure.resourcemanager.security.models.DataExportSettings; -import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; -/** - * Samples for Settings Update. - */ -public final class SettingsUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/ - * UpdateSetting_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScoreControlsForName_builtin_example.json */ /** - * Sample code: Update a setting for subscription. + * Sample code: Get security controls and their current score for the specified initiative. * * @param manager Entry point to SecurityManager. */ - public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings() - .updateWithResponse(SettingNameAutoGenerated.WDATP, new DataExportSettings().withEnabled(true), - com.azure.core.util.Context.NONE); + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().listBySecureScore("ascScore", null, com.azure.core.util.Context.NONE); } } ``` -### SoftwareInventories_Get +### SecureScores_Get ```java /** - * Samples for SoftwareInventories Get. + * Samples for SecureScores Get. */ -public final class SoftwareInventoriesGetSamples { +public final class SecureScoresGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/ - * SoftwareInventories/GetSoftware_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * GetSecureScoresSingle_example.json */ /** - * Sample code: Gets a single software data of the virtual machine. + * Sample code: Get single secure score. * * @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", com.azure.core.util.Context.NONE); + public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().getWithResponse("ascScore", com.azure.core.util.Context.NONE); } } ``` -### SoftwareInventories_List +### SecureScores_List ```java /** - * Samples for SoftwareInventories List. + * Samples for SecureScores List. */ -public final class SoftwareInventoriesListSamples { +public final class SecureScoresListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/ - * SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScores_example.json */ /** - * Sample code: Gets the software inventory of all virtual machines in the subscriptions. + * Sample code: List secure scores. * * @param manager Entry point to SecurityManager. */ - public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.softwareInventories().list(com.azure.core.util.Context.NONE); + public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().list(com.azure.core.util.Context.NONE); } } ``` -### SoftwareInventories_ListByExtendedResource +### SecuritySolutions_Get ```java /** - * Samples for SoftwareInventories ListByExtendedResource. + * Samples for SecuritySolutions Get. */ -public final class SoftwareInventoriesListByExtendedResourceSamples { +public final class SecuritySolutionsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/ - * SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/ + * GetSecuritySolutionsResourceGroupLocation_example.json */ /** - * Sample code: Gets the software inventory of the virtual machine. + * Sample code: Get a security solution from a security data location. * * @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", - com.azure.core.util.Context.NONE); + getASecuritySolutionFromASecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } ``` -### SqlVulnerabilityAssessmentBaselineRules_Add +### SecuritySolutions_List ```java -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for SqlVulnerabilityAssessmentBaselineRules Add. + * Samples for SecuritySolutions List. */ -public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { +public final class SecuritySolutionsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/ + * GetSecuritySolutionsSubscription_example.json */ /** - * Sample code: Create a baseline for all rules. + * Sample code: Get security solutions. * * @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")))), - com.azure.core.util.Context.NONE); + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().list(com.azure.core.util.Context.NONE); } +} +``` + +### SecuritySolutionsReferenceData_List +```java +/** + * Samples for SecuritySolutionsReferenceData List. + */ +public final class SecuritySolutionsReferenceDataListSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json */ /** - * Sample code: Create a baseline for all rules using the latest scan results. + * Sample code: Get security solutions. * * @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()), com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE); } } ``` -### SqlVulnerabilityAssessmentBaselineRules_CreateOrUpdate +### SecuritySolutionsReferenceData_ListByHomeRegion ```java -import java.util.Arrays; - /** - * Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. + * Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ -public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { +public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json */ /** - * Sample code: Create a baseline using the latest scan results. + * Sample code: Get security solutions from a security data location. * * @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/2023-02-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(); + getSecuritySolutionsFromASecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas() + .listByHomeRegionWithResponse("westcentralus", com.azure.core.util.Context.NONE); } } ``` -### SqlVulnerabilityAssessmentBaselineRules_Delete +### SecurityStandards_CreateOrUpdate ```java +import com.azure.resourcemanager.security.models.PartialAssessmentProperties; +import com.azure.resourcemanager.security.models.StandardSupportedCloud; +import java.util.Arrays; + /** - * Samples for SqlVulnerabilityAssessmentBaselineRules Delete. + * Samples for SecurityStandards CreateOrUpdate. */ -public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { +public final class SecurityStandardsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * PutBySubscriptionSecurityStandard_example.json */ /** - * Sample code: Delete the baseline. + * Sample code: Create or update security standard over subscription scope. * * @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", - com.azure.core.util.Context.NONE); + public static void createOrUpdateSecurityStandardOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), + new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) + .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) + .withPolicySetDefinitionId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Authorization/policySetDefinitions/patchorchestration-applicationversions") + .create(); } -} -``` -### SqlVulnerabilityAssessmentBaselineRules_Get - -```java -/** - * Samples for SqlVulnerabilityAssessmentBaselineRules Get. - */ -public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * PutBySecurityConnectorSecurityStandard_example.json */ /** - * Sample code: Get the baseline. + * Sample code: Create or update security standard over security connector scope. * * @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", - com.azure.core.util.Context.NONE); + public static void createOrUpdateSecurityStandardOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), + new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) + .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) + .create(); } -} -``` -### SqlVulnerabilityAssessmentBaselineRules_List - -```java -/** - * Samples for SqlVulnerabilityAssessmentBaselineRules List. - */ -public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * PutByManagementGroupSecurityStandard_example.json */ /** - * Sample code: List baseline for all rules. + * Sample code: Create or update security standard over management group scope. * * @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", - com.azure.core.util.Context.NONE); + public static void createOrUpdateSecurityStandardOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), + new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) + .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) + .withPolicySetDefinitionId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Authorization/policySetDefinitions/patchorchestration-applicationversions") + .create(); } } ``` -### SqlVulnerabilityAssessmentScanResults_Get +### SecurityStandards_Delete ```java /** - * Samples for SqlVulnerabilityAssessmentScanResults Get. + * Samples for SecurityStandards Delete. */ -public final class SqlVulnerabilityAssessmentScanResultsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-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", - com.azure.core.util.Context.NONE); - } - +public final class SecurityStandardsDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * DeleteBySecurityConnectorSecurityStandard_example.json */ /** - * Sample code: Get scan details of the latest scan record. + * Sample code: Delete a security standard over security connector scope. * * @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", - com.azure.core.util.Context.NONE); + public static void + deleteASecurityStandardOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } -} -``` -### SqlVulnerabilityAssessmentScanResults_List - -```java -/** - * Samples for SqlVulnerabilityAssessmentScanResults List. - */ -public final class SqlVulnerabilityAssessmentScanResultsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * DeleteByManagementGroupSecurityStandard_example.json */ /** - * Sample code: List scan results of the latest scan. + * Sample code: Delete a security standard over management group scope. * * @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", - com.azure.core.util.Context.NONE); + public static void + deleteASecurityStandardOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .deleteByResourceGroupWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * DeleteBySubscriptionSecurityStandard_example.json */ /** - * Sample code: List scan results. + * Sample code: Delete a security standard over subscription scope. * * @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", - com.azure.core.util.Context.NONE); + public static void + deleteASecurityStandardOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .deleteByResourceGroupWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` -### SqlVulnerabilityAssessmentScans_Get +### SecurityStandards_Get ```java /** - * Samples for SqlVulnerabilityAssessmentScans Get. + * Samples for SecurityStandards Get. */ -public final class SqlVulnerabilityAssessmentScansGetSamples { +public final class SecurityStandardsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * GetBySecurityConnectorSecurityStandard_example.json */ /** - * Sample code: Get scan details of a scan record. + * Sample code: Get a security standard over security connector scope. * * @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", - com.azure.core.util.Context.NONE); + public static void + getASecurityStandardOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * GetByManagementGroupSecurityStandard_example.json */ /** - * Sample code: Get scan details of the latest scan record. + * Sample code: Get a security standard over management group scope. * * @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", - com.azure.core.util.Context.NONE); + public static void + getASecurityStandardOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } -} -``` -### SqlVulnerabilityAssessmentScans_List - -```java -/** - * Samples for SqlVulnerabilityAssessmentScans List. - */ -public final class SqlVulnerabilityAssessmentScansListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ - * sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * GetBySubscriptionSecurityStandard_example.json */ /** - * Sample code: List scan details. + * Sample code: Get a security standard over subscription scope. * * @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", - com.azure.core.util.Context.NONE); + public static void + getASecurityStandardOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } } ``` -### StandardAssignments_Create +### SecurityStandards_List ```java -import com.azure.resourcemanager.security.models.AssignedAssessmentItem; -import com.azure.resourcemanager.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.Effect; -import com.azure.resourcemanager.security.models.ExemptionCategory; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData; -import java.time.OffsetDateTime; -import java.util.Arrays; - /** - * Samples for StandardAssignments Create. + * Samples for SecurityStandards List. */ -public final class StandardAssignmentsCreateSamples { +public final class SecurityStandardsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ - * PutStandardAssignment.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * ListByManagementGroupSecurityStandards_example.json */ /** - * Sample code: Put an audit standard assignment. + * Sample code: List security standards by management group scope. * * @param manager Entry point to SecurityManager. */ - public static void putAnAuditStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.standardAssignments() - .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") - .withExistingResourceId("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .withDisplayName("ASC Default") - .withDescription("Set of policies monitored by Azure Security Center for cross cloud") - .withAssignedStandard(new AssignedStandardItem() - .withId("/providers/Microsoft.Security/securityStandards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) - .withEffect(Effect.AUDIT) - .withExcludedScopes(Arrays.asList()) - .create(); + public static void + listSecurityStandardsByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ - * PutExemptionStandardAssignment.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * ListBySubscriptionSecurityStandards_example.json */ /** - * Sample code: Put exemption standard assignment. + * Sample code: List security standards by subscription scope. * * @param manager Entry point to SecurityManager. */ - public static void putExemptionStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.standardAssignments() - .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") - .withExistingResourceId( - "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ANAT_TEST_RG/providers/Microsoft.Compute/virtualMachines/anatTestE2LA") - .withDisplayName("Test exemption") - .withDescription("Exemption description") - .withAssignedStandard(new AssignedStandardItem() - .withId("/providers/Microsoft.Security/securityStandards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) - .withEffect(Effect.EXEMPT) - .withExpiresOn(OffsetDateTime.parse("2022-05-01T19:50:47.083633Z")) - .withExemptionData( - new StandardAssignmentPropertiesExemptionData().withExemptionCategory(ExemptionCategory.WAIVER) - .withAssignedAssessment(new AssignedAssessmentItem().withAssessmentKey("fakeTokenPlaceholder"))) - .create(); + public static void + listSecurityStandardsBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } -} -``` - -### StandardAssignments_Delete -```java -/** - * Samples for StandardAssignments Delete. - */ -public final class StandardAssignmentsDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ - * DeleteStandardAssignment.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/SecurityStandards/ + * ListBySecurityConnectorSecurityStandards_example.json */ /** - * Sample code: Delete a standard assignment. + * Sample code: List security standards by security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void deleteAStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.standardAssignments() - .deleteByResourceGroupWithResponse( + public static void + listSecurityStandardsBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} -``` - -### StandardAssignments_Get - -```java -/** - * Samples for StandardAssignments Get. - */ -public final class StandardAssignmentsGetSamples { - /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ - * GetStandardAssignment.json - */ - /** - * Sample code: Retrieve a standard assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void retrieveAStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager.standardAssignments() - .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", - "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + com.azure.core.util.Context.NONE); } } ``` -### StandardAssignments_List +### ServerVulnerabilityAssessment_CreateOrUpdate ```java /** - * Samples for StandardAssignments List. + * Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ -public final class StandardAssignmentsListSamples { +public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ - * ListStandardAssignments.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json */ /** - * Sample code: List standard assignments. + * 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 listStandardAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.standardAssignments() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + public static void + createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` -### SubAssessments_Get +### ServerVulnerabilityAssessment_Delete ```java /** - * Samples for SubAssessments Get. + * Samples for ServerVulnerabilityAssessment Delete. */ -public final class SubAssessmentsGetSamples { +public final class ServerVulnerabilityAssessmentDeleteSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ - * GetSubAssessment_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json */ /** - * Sample code: Get security recommendation task from security data location. + * 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 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", - com.azure.core.util.Context.NONE); + public static void + deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` -### SubAssessments_List +### ServerVulnerabilityAssessment_Get ```java /** - * Samples for SubAssessments List. + * Samples for ServerVulnerabilityAssessment Get. */ -public final class SubAssessmentsListSamples { +public final class ServerVulnerabilityAssessmentGetSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ - * ListSubAssessments_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json */ /** - * Sample code: List security sub-assessments. + * 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 listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.subAssessments() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", - com.azure.core.util.Context.NONE); + public static void + getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` -### SubAssessments_ListAll +### ServerVulnerabilityAssessment_ListByExtendedResource ```java /** - * Samples for SubAssessments ListAll. + * Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ -public final class SubAssessmentsListAllSamples { +public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ - * ListSubscriptionSubAssessments_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json */ /** - * Sample code: List security sub-assessments. + * 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 listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.subAssessments() - .listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + public static void + getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + com.azure.core.util.Context.NONE); } } ``` -### Tasks_GetResourceGroupLevelTask +### ServerVulnerabilityAssessmentsSettings_CreateOrUpdate ```java +import com.azure.resourcemanager.security.models.AzureServersSetting; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + /** - * Samples for Tasks GetResourceGroupLevelTask. + * Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate. */ -public final class TasksGetResourceGroupLevelTaskSamples { +public final class ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * GetTaskResourceGroupLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json */ /** - * Sample code: Get security recommendation task in a resource group. + * Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription. * * @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", + public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings() + .createOrUpdateWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + new AzureServersSetting() + .withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM), com.azure.core.util.Context.NONE); } } ``` -### Tasks_GetSubscriptionLevelTask +### ServerVulnerabilityAssessmentsSettings_Delete ```java +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + /** - * Samples for Tasks GetSubscriptionLevelTask. + * Samples for ServerVulnerabilityAssessmentsSettings Delete. */ -public final class TasksGetSubscriptionLevelTaskSamples { +public final class ServerVulnerabilityAssessmentsSettingsDeleteSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * GetTaskSubscriptionLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json */ /** - * Sample code: Get security recommendation task from security data location. + * Sample code: Delete the server vulnerability assessments setting of the kind settingKind from the subscription. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( + public static void deleteTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindFromTheSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks() - .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", + manager.serverVulnerabilityAssessmentsSettings() + .deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); } } ``` -### Tasks_List +### ServerVulnerabilityAssessmentsSettings_Get ```java +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + /** - * Samples for Tasks List. + * Samples for ServerVulnerabilityAssessmentsSettings Get. */ -public final class TasksListSamples { +public final class ServerVulnerabilityAssessmentsSettingsGetSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * GetTasksSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json */ /** - * Sample code: Get security recommendations tasks. + * Sample code: Get the server vulnerability assessments setting of the kind settingKind that is set on the + * subscription. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().list(null, com.azure.core.util.Context.NONE); + public static void getTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindThatIsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings() + .getWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + com.azure.core.util.Context.NONE); } } ``` -### Tasks_ListByHomeRegion +### ServerVulnerabilityAssessmentsSettings_List ```java /** - * Samples for Tasks ListByHomeRegion. + * Samples for ServerVulnerabilityAssessmentsSettings List. */ -public final class TasksListByHomeRegionSamples { +public final class ServerVulnerabilityAssessmentsSettingsListSamples { /* - * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * GetTasksSubscriptionLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json */ /** - * Sample code: Get security recommendations tasks from security data location. + * Sample code: List the server vulnerability assessments settings set on the subscription. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityRecommendationsTasksFromSecurityDataLocation( + public static void listTheServerVulnerabilityAssessmentsSettingsSetOnTheSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByHomeRegion("westeurope", null, com.azure.core.util.Context.NONE); + manager.serverVulnerabilityAssessmentsSettings().list(com.azure.core.util.Context.NONE); } } ``` -### Tasks_ListByResourceGroup +### Settings_Get ```java +import com.azure.resourcemanager.security.models.SettingName; + /** - * Samples for Tasks ListByResourceGroup. + * Samples for Settings Get. */ -public final class TasksListByResourceGroupSamples { +public final class SettingsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * GetTasksResourceGroupLocation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example + * .json */ /** - * Sample code: Get security recommendation tasks in a resource group. + * Sample code: Get a setting on subscription. * * @param manager Entry point to SecurityManager. */ - public static void - getSecurityRecommendationTasksInAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByResourceGroup("myRg", "westeurope", null, com.azure.core.util.Context.NONE); + public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().getWithResponse(SettingName.WDATP, com.azure.core.util.Context.NONE); } } ``` -### Tasks_UpdateResourceGroupLevelTaskState +### Settings_List ```java -import com.azure.resourcemanager.security.models.TaskUpdateActionType; - /** - * Samples for Tasks UpdateResourceGroupLevelTaskState. + * Samples for Settings List. */ -public final class TasksUpdateResourceGroupLevelTaskStateSamples { +public final class SettingsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * UpdateTaskResourceGroupLocation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/ + * GetSettings_example.json */ /** - * Sample code: Change security recommendation task state. + * Sample code: Get settings of subscription. * * @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", - TaskUpdateActionType.DISMISS, com.azure.core.util.Context.NONE); + public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().list(com.azure.core.util.Context.NONE); } } ``` -### Tasks_UpdateSubscriptionLevelTaskState +### Settings_Update ```java -import com.azure.resourcemanager.security.models.TaskUpdateActionType; +import com.azure.resourcemanager.security.models.DataExportSettings; +import com.azure.resourcemanager.security.models.SettingName; /** - * Samples for Tasks UpdateSubscriptionLevelTaskState. + * Samples for Settings Update. */ -public final class TasksUpdateSubscriptionLevelTaskStateSamples { +public final class SettingsUpdateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ - * UpdateTaskSubscriptionLocation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/ + * UpdateSetting_example.json */ /** - * Sample code: Change security recommendation task state. + * Sample code: Update a setting for subscription. * * @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", - TaskUpdateActionType.DISMISS, com.azure.core.util.Context.NONE); + public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings() + .updateWithResponse(SettingName.WDATP, new DataExportSettings().withEnabled(true), + com.azure.core.util.Context.NONE); } } ``` -### Topology_Get +### StandardAssignments_Create ```java +import com.azure.resourcemanager.security.models.AssignedAssessmentItem; +import com.azure.resourcemanager.security.models.AssignedStandardItem; +import com.azure.resourcemanager.security.models.Effect; +import com.azure.resourcemanager.security.models.ExemptionCategory; +import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData; +import java.time.OffsetDateTime; +import java.util.Arrays; + /** - * Samples for Topology Get. + * Samples for StandardAssignments Create. */ -public final class TopologyGetSamples { +public final class StandardAssignmentsCreateSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ - * GetTopology_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ + * PutStandardAssignment.json */ /** - * Sample code: Get topology. + * Sample code: Put an audit standard assignment. * * @param manager Entry point to SecurityManager. */ - public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().getWithResponse("myservers", "centralus", "vnets", com.azure.core.util.Context.NONE); + public static void putAnAuditStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") + .withExistingResourceId("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .withDisplayName("ASC Default") + .withDescription("Set of policies monitored by Azure Security Center for cross cloud") + .withAssignedStandard(new AssignedStandardItem() + .withId("/providers/Microsoft.Security/securityStandards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) + .withEffect(Effect.AUDIT) + .withExcludedScopes(Arrays.asList()) + .create(); } -} -``` - -### Topology_List -```java -/** - * 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 + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ + * PutExemptionStandardAssignment.json */ /** - * Sample code: Get topology on a subscription. + * Sample code: Put exemption standard assignment. * * @param manager Entry point to SecurityManager. */ - public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().list(com.azure.core.util.Context.NONE); + public static void putExemptionStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") + .withExistingResourceId( + "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ANAT_TEST_RG/providers/Microsoft.Compute/virtualMachines/anatTestE2LA") + .withDisplayName("Test exemption") + .withDescription("Exemption description") + .withAssignedStandard(new AssignedStandardItem() + .withId("/providers/Microsoft.Security/securityStandards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) + .withEffect(Effect.EXEMPT) + .withExpiresOn(OffsetDateTime.parse("2022-05-01T19:50:47.083633Z")) + .withExemptionData( + new StandardAssignmentPropertiesExemptionData().withExemptionCategory(ExemptionCategory.WAIVER) + .withAssignedAssessment(new AssignedAssessmentItem().withAssessmentKey("fakeTokenPlaceholder"))) + .create(); } } ``` -### Topology_ListByHomeRegion +### StandardAssignments_Delete ```java /** - * Samples for Topology ListByHomeRegion. + * Samples for StandardAssignments Delete. */ -public final class TopologyListByHomeRegionSamples { +public final class StandardAssignmentsDeleteSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ - * GetTopologySubscriptionLocation_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ + * DeleteStandardAssignment.json */ /** - * Sample code: Get topology on a subscription from security data location. + * Sample code: Delete a standard assignment. * * @param manager Entry point to SecurityManager. */ - public static void - getTopologyOnASubscriptionFromSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + public static void deleteAStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` -### WorkspaceSettings_Create +### StandardAssignments_Get ```java /** - * Samples for WorkspaceSettings Create. + * Samples for StandardAssignments Get. */ -public final class WorkspaceSettingsCreateSamples { +public final class StandardAssignmentsGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ - * CreateWorkspaceSetting_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ + * GetStandardAssignment.json */ /** - * Sample code: Create a workspace setting data for subscription. + * Sample code: Retrieve a standard assignment. * * @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(); + public static void retrieveAStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); } } ``` -### WorkspaceSettings_Delete +### StandardAssignments_List ```java /** - * Samples for WorkspaceSettings Delete. + * Samples for StandardAssignments List. */ -public final class WorkspaceSettingsDeleteSamples { +public final class StandardAssignmentsListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ - * DeleteWorkspaceSetting_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/StandardAssignments/ + * ListStandardAssignments.json */ /** - * Sample code: Delete a workspace setting data for resource group. + * Sample code: List standard assignments. * * @param manager Entry point to SecurityManager. */ - public static void - deleteAWorkspaceSettingDataForResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); + public static void listStandardAssignments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); } } ``` -### WorkspaceSettings_Get +### Topology_Get ```java /** - * Samples for WorkspaceSettings Get. + * Samples for Topology Get. */ -public final class WorkspaceSettingsGetSamples { +public final class TopologyGetSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ - * GetWorkspaceSetting_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ + * GetTopology_example.json */ /** - * Sample code: Get a workspace setting on subscription. + * Sample code: Get topology. * * @param manager Entry point to SecurityManager. */ - public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE); + public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().getWithResponse("myservers", "centralus", "vnets", com.azure.core.util.Context.NONE); } } ``` -### WorkspaceSettings_List +### Topology_List ```java /** - * Samples for WorkspaceSettings List. + * Samples for Topology List. */ -public final class WorkspaceSettingsListSamples { +public final class TopologyListSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ - * GetWorkspaceSettings_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ + * GetTopologySubscription_example.json */ /** - * Sample code: Get workspace settings on subscription. + * Sample code: Get topology on a subscription. * * @param manager Entry point to SecurityManager. */ - public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().list(com.azure.core.util.Context.NONE); + public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().list(com.azure.core.util.Context.NONE); } } ``` -### WorkspaceSettings_Update +### Topology_ListByHomeRegion ```java -import com.azure.resourcemanager.security.models.WorkspaceSetting; - /** - * Samples for WorkspaceSettings Update. + * Samples for Topology ListByHomeRegion. */ -public final class WorkspaceSettingsUpdateSamples { +public final class TopologyListByHomeRegionSamples { /* * x-ms-original-file: - * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ - * UpdateWorkspaceSetting_example.json + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ + * GetTopologySubscriptionLocation_example.json */ /** - * Sample code: Update a workspace setting data for subscription. + * Sample code: Get topology on a subscription from security data location. * * @param manager Entry point to SecurityManager. */ public static void - updateAWorkspaceSettingDataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - WorkspaceSetting resource - = manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); - resource.update() - .withWorkspaceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") - .apply(); + getTopologyOnASubscriptionFromSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/security/azure-resourcemanager-security/pom.xml b/sdk/security/azure-resourcemanager-security/pom.xml index 4f9b36f8bd0cc..6ccc2233f3460 100644 --- a/sdk/security/azure-resourcemanager-security/pom.xml +++ b/sdk/security/azure-resourcemanager-security/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-security - 1.0.0-beta.9 + 1.0.0 jar Microsoft Azure SDK for Security Management @@ -45,7 +45,6 @@ UTF-8 0 0 - true false 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 0d84e621ce5c8..7899208378023 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 @@ -26,151 +26,61 @@ import com.azure.resourcemanager.security.fluent.SecurityCenter; import com.azure.resourcemanager.security.implementation.AdvancedThreatProtectionsImpl; import com.azure.resourcemanager.security.implementation.AlertsImpl; -import com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesImpl; import com.azure.resourcemanager.security.implementation.AllowedConnectionsImpl; import com.azure.resourcemanager.security.implementation.ApiCollectionsImpl; -import com.azure.resourcemanager.security.implementation.ApplicationOperationsImpl; -import com.azure.resourcemanager.security.implementation.ApplicationsImpl; import com.azure.resourcemanager.security.implementation.AssessmentsImpl; import com.azure.resourcemanager.security.implementation.AssessmentsMetadatasImpl; -import com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsImpl; -import com.azure.resourcemanager.security.implementation.AutomationsImpl; -import com.azure.resourcemanager.security.implementation.AzureDevOpsOrgsImpl; -import com.azure.resourcemanager.security.implementation.AzureDevOpsProjectsImpl; -import com.azure.resourcemanager.security.implementation.AzureDevOpsReposImpl; import com.azure.resourcemanager.security.implementation.ComplianceResultsImpl; -import com.azure.resourcemanager.security.implementation.CompliancesImpl; -import com.azure.resourcemanager.security.implementation.ConnectorsImpl; -import com.azure.resourcemanager.security.implementation.CustomAssessmentAutomationsImpl; -import com.azure.resourcemanager.security.implementation.CustomEntityStoreAssignmentsImpl; import com.azure.resourcemanager.security.implementation.CustomRecommendationsImpl; -import com.azure.resourcemanager.security.implementation.DefenderForStoragesImpl; -import com.azure.resourcemanager.security.implementation.DevOpsConfigurationsImpl; -import com.azure.resourcemanager.security.implementation.DevOpsOperationResultsImpl; -import com.azure.resourcemanager.security.implementation.DevOpsPoliciesImpl; -import com.azure.resourcemanager.security.implementation.DevOpsPolicyAssignmentsImpl; import com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsImpl; import com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.GitHubOwnersImpl; -import com.azure.resourcemanager.security.implementation.GitHubReposImpl; -import com.azure.resourcemanager.security.implementation.GitLabGroupsImpl; -import com.azure.resourcemanager.security.implementation.GitLabProjectsImpl; -import com.azure.resourcemanager.security.implementation.GitLabSubgroupsImpl; -import com.azure.resourcemanager.security.implementation.GovernanceAssignmentsImpl; -import com.azure.resourcemanager.security.implementation.GovernanceRulesImpl; -import com.azure.resourcemanager.security.implementation.HealthReportsImpl; -import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; 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.JitNetworkAccessPoliciesImpl; -import com.azure.resourcemanager.security.implementation.LocationsImpl; -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; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsImpl; 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.SecurityConnectorApplicationOperationsImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorsImpl; -import com.azure.resourcemanager.security.implementation.SecurityContactsImpl; -import com.azure.resourcemanager.security.implementation.SecurityOperatorsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasImpl; import com.azure.resourcemanager.security.implementation.SecurityStandardsImpl; -import com.azure.resourcemanager.security.implementation.SensitivitySettingsImpl; import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsImpl; import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsSettingsImpl; import com.azure.resourcemanager.security.implementation.SettingsImpl; -import com.azure.resourcemanager.security.implementation.SoftwareInventoriesImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansImpl; import com.azure.resourcemanager.security.implementation.StandardAssignmentsImpl; -import com.azure.resourcemanager.security.implementation.SubAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.TasksImpl; import com.azure.resourcemanager.security.implementation.TopologiesImpl; -import com.azure.resourcemanager.security.implementation.WorkspaceSettingsImpl; import com.azure.resourcemanager.security.models.AdvancedThreatProtections; import com.azure.resourcemanager.security.models.Alerts; -import com.azure.resourcemanager.security.models.AlertsSuppressionRules; import com.azure.resourcemanager.security.models.AllowedConnections; import com.azure.resourcemanager.security.models.ApiCollections; -import com.azure.resourcemanager.security.models.ApplicationOperations; -import com.azure.resourcemanager.security.models.Applications; import com.azure.resourcemanager.security.models.Assessments; import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.AutoProvisioningSettings; -import com.azure.resourcemanager.security.models.Automations; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgs; -import com.azure.resourcemanager.security.models.AzureDevOpsProjects; -import com.azure.resourcemanager.security.models.AzureDevOpsRepos; import com.azure.resourcemanager.security.models.ComplianceResults; -import com.azure.resourcemanager.security.models.Compliances; -import com.azure.resourcemanager.security.models.Connectors; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignments; import com.azure.resourcemanager.security.models.CustomRecommendations; -import com.azure.resourcemanager.security.models.DefenderForStorages; -import com.azure.resourcemanager.security.models.DevOpsConfigurations; -import com.azure.resourcemanager.security.models.DevOpsOperationResults; -import com.azure.resourcemanager.security.models.DevOpsPolicies; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignments; import com.azure.resourcemanager.security.models.DeviceSecurityGroups; import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; -import com.azure.resourcemanager.security.models.GitHubOwners; -import com.azure.resourcemanager.security.models.GitHubRepos; -import com.azure.resourcemanager.security.models.GitLabGroups; -import com.azure.resourcemanager.security.models.GitLabProjects; -import com.azure.resourcemanager.security.models.GitLabSubgroups; -import com.azure.resourcemanager.security.models.GovernanceAssignments; -import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.HealthReports; -import com.azure.resourcemanager.security.models.InformationProtectionPolicies; 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.JitNetworkAccessPolicies; -import com.azure.resourcemanager.security.models.Locations; -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; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; 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.SecurityConnectorApplicationOperations; -import com.azure.resourcemanager.security.models.SecurityConnectorApplications; -import com.azure.resourcemanager.security.models.SecurityConnectors; -import com.azure.resourcemanager.security.models.SecurityContacts; -import com.azure.resourcemanager.security.models.SecurityOperators; import com.azure.resourcemanager.security.models.SecuritySolutions; import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; import com.azure.resourcemanager.security.models.SecurityStandards; -import com.azure.resourcemanager.security.models.SensitivitySettings; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettings; import com.azure.resourcemanager.security.models.Settings; -import com.azure.resourcemanager.security.models.SoftwareInventories; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; import com.azure.resourcemanager.security.models.StandardAssignments; -import com.azure.resourcemanager.security.models.SubAssessments; -import com.azure.resourcemanager.security.models.Tasks; import com.azure.resourcemanager.security.models.Topologies; -import com.azure.resourcemanager.security.models.WorkspaceSettings; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -183,96 +93,6 @@ * API spec for Microsoft.Security (Azure Security Center) resource provider. */ public final class SecurityManager { - private Locations locations; - - private Operations operations; - - private Tasks tasks; - - private AutoProvisioningSettings autoProvisioningSettings; - - private Compliances compliances; - - private InformationProtectionPolicies informationProtectionPolicies; - - private WorkspaceSettings workspaceSettings; - - private AlertsSuppressionRules alertsSuppressionRules; - - private RegulatoryComplianceStandards regulatoryComplianceStandards; - - private RegulatoryComplianceControls regulatoryComplianceControls; - - private RegulatoryComplianceAssessments regulatoryComplianceAssessments; - - private SubAssessments subAssessments; - - private Connectors connectors; - - private SoftwareInventories softwareInventories; - - private CustomAssessmentAutomations customAssessmentAutomations; - - private CustomEntityStoreAssignments customEntityStoreAssignments; - - private MdeOnboardings mdeOnboardings; - - private GovernanceAssignments governanceAssignments; - - private GovernanceRules governanceRules; - - private Applications applications; - - private ApplicationOperations applicationOperations; - - private SecurityConnectorApplications securityConnectorApplications; - - private SecurityConnectorApplicationOperations securityConnectorApplicationOperations; - - private DefenderForStorages defenderForStorages; - - private SecurityOperators securityOperators; - - private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - - private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; - - private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; - - private SensitivitySettings sensitivitySettings; - - private HealthReports healthReports; - - private Automations automations; - - private SecurityContacts securityContacts; - - private SecurityConnectors securityConnectors; - - private AzureDevOpsOrgs azureDevOpsOrgs; - - private AzureDevOpsProjects azureDevOpsProjects; - - private AzureDevOpsRepos azureDevOpsRepos; - - private DevOpsConfigurations devOpsConfigurations; - - private DevOpsPolicies devOpsPolicies; - - private DevOpsPolicyAssignments devOpsPolicyAssignments; - - private GitHubOwners gitHubOwners; - - private GitHubRepos gitHubRepos; - - private GitLabGroups gitLabGroups; - - private GitLabSubgroups gitLabSubgroups; - - private GitLabProjects gitLabProjects; - - private DevOpsOperationResults devOpsOperationResults; - private ComplianceResults complianceResults; private AdvancedThreatProtections advancedThreatProtections; @@ -493,7 +313,7 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro .append("-") .append("com.azure.resourcemanager.security") .append("/") - .append("1.0.0-beta.8"); + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -539,561 +359,6 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro } } - /** - * Gets the resource collection API of Locations. - * - * @return Resource collection API of Locations. - */ - public Locations locations() { - if (this.locations == null) { - this.locations = new LocationsImpl(clientObject.getLocations(), this); - } - return locations; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of Tasks. - * - * @return Resource collection API of Tasks. - */ - public Tasks tasks() { - if (this.tasks == null) { - this.tasks = new TasksImpl(clientObject.getTasks(), this); - } - return tasks; - } - - /** - * Gets the resource collection API of AutoProvisioningSettings. It manages AutoProvisioningSetting. - * - * @return Resource collection API of AutoProvisioningSettings. - */ - public AutoProvisioningSettings autoProvisioningSettings() { - if (this.autoProvisioningSettings == null) { - this.autoProvisioningSettings - = new AutoProvisioningSettingsImpl(clientObject.getAutoProvisioningSettings(), this); - } - return autoProvisioningSettings; - } - - /** - * Gets the resource collection API of Compliances. - * - * @return Resource collection API of Compliances. - */ - public Compliances compliances() { - if (this.compliances == null) { - this.compliances = new CompliancesImpl(clientObject.getCompliances(), this); - } - return compliances; - } - - /** - * Gets the resource collection API of InformationProtectionPolicies. It manages InformationProtectionPolicy. - * - * @return Resource collection API of InformationProtectionPolicies. - */ - public InformationProtectionPolicies informationProtectionPolicies() { - if (this.informationProtectionPolicies == null) { - this.informationProtectionPolicies - = new InformationProtectionPoliciesImpl(clientObject.getInformationProtectionPolicies(), this); - } - return informationProtectionPolicies; - } - - /** - * Gets the resource collection API of WorkspaceSettings. It manages WorkspaceSetting. - * - * @return Resource collection API of WorkspaceSettings. - */ - public WorkspaceSettings workspaceSettings() { - if (this.workspaceSettings == null) { - this.workspaceSettings = new WorkspaceSettingsImpl(clientObject.getWorkspaceSettings(), this); - } - return workspaceSettings; - } - - /** - * Gets the resource collection API of AlertsSuppressionRules. - * - * @return Resource collection API of AlertsSuppressionRules. - */ - public AlertsSuppressionRules alertsSuppressionRules() { - if (this.alertsSuppressionRules == null) { - this.alertsSuppressionRules - = new AlertsSuppressionRulesImpl(clientObject.getAlertsSuppressionRules(), this); - } - return alertsSuppressionRules; - } - - /** - * Gets the resource collection API of RegulatoryComplianceStandards. - * - * @return Resource collection API of RegulatoryComplianceStandards. - */ - public RegulatoryComplianceStandards regulatoryComplianceStandards() { - if (this.regulatoryComplianceStandards == null) { - this.regulatoryComplianceStandards - = new RegulatoryComplianceStandardsImpl(clientObject.getRegulatoryComplianceStandards(), this); - } - return regulatoryComplianceStandards; - } - - /** - * Gets the resource collection API of RegulatoryComplianceControls. - * - * @return Resource collection API of RegulatoryComplianceControls. - */ - public RegulatoryComplianceControls regulatoryComplianceControls() { - if (this.regulatoryComplianceControls == null) { - this.regulatoryComplianceControls - = new RegulatoryComplianceControlsImpl(clientObject.getRegulatoryComplianceControls(), this); - } - return regulatoryComplianceControls; - } - - /** - * Gets the resource collection API of RegulatoryComplianceAssessments. - * - * @return Resource collection API of RegulatoryComplianceAssessments. - */ - public RegulatoryComplianceAssessments regulatoryComplianceAssessments() { - if (this.regulatoryComplianceAssessments == null) { - this.regulatoryComplianceAssessments - = new RegulatoryComplianceAssessmentsImpl(clientObject.getRegulatoryComplianceAssessments(), this); - } - return regulatoryComplianceAssessments; - } - - /** - * Gets the resource collection API of SubAssessments. - * - * @return Resource collection API of SubAssessments. - */ - public SubAssessments subAssessments() { - if (this.subAssessments == null) { - this.subAssessments = new SubAssessmentsImpl(clientObject.getSubAssessments(), this); - } - return subAssessments; - } - - /** - * Gets the resource collection API of Connectors. It manages ConnectorSetting. - * - * @return Resource collection API of Connectors. - */ - public Connectors connectors() { - if (this.connectors == null) { - this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this); - } - return connectors; - } - - /** - * Gets the resource collection API of SoftwareInventories. - * - * @return Resource collection API of SoftwareInventories. - */ - public SoftwareInventories softwareInventories() { - if (this.softwareInventories == null) { - this.softwareInventories = new SoftwareInventoriesImpl(clientObject.getSoftwareInventories(), this); - } - return softwareInventories; - } - - /** - * Gets the resource collection API of CustomAssessmentAutomations. It manages CustomAssessmentAutomation. - * - * @return Resource collection API of CustomAssessmentAutomations. - */ - public CustomAssessmentAutomations customAssessmentAutomations() { - if (this.customAssessmentAutomations == null) { - this.customAssessmentAutomations - = new CustomAssessmentAutomationsImpl(clientObject.getCustomAssessmentAutomations(), this); - } - return customAssessmentAutomations; - } - - /** - * Gets the resource collection API of CustomEntityStoreAssignments. It manages CustomEntityStoreAssignment. - * - * @return Resource collection API of CustomEntityStoreAssignments. - */ - public CustomEntityStoreAssignments customEntityStoreAssignments() { - if (this.customEntityStoreAssignments == null) { - this.customEntityStoreAssignments - = new CustomEntityStoreAssignmentsImpl(clientObject.getCustomEntityStoreAssignments(), this); - } - return customEntityStoreAssignments; - } - - /** - * Gets the resource collection API of MdeOnboardings. - * - * @return Resource collection API of MdeOnboardings. - */ - public MdeOnboardings mdeOnboardings() { - if (this.mdeOnboardings == null) { - this.mdeOnboardings = new MdeOnboardingsImpl(clientObject.getMdeOnboardings(), this); - } - return mdeOnboardings; - } - - /** - * Gets the resource collection API of GovernanceAssignments. It manages GovernanceAssignment. - * - * @return Resource collection API of GovernanceAssignments. - */ - public GovernanceAssignments governanceAssignments() { - if (this.governanceAssignments == null) { - this.governanceAssignments = new GovernanceAssignmentsImpl(clientObject.getGovernanceAssignments(), this); - } - return governanceAssignments; - } - - /** - * Gets the resource collection API of GovernanceRules. It manages GovernanceRule. - * - * @return Resource collection API of GovernanceRules. - */ - public GovernanceRules governanceRules() { - if (this.governanceRules == null) { - this.governanceRules = new GovernanceRulesImpl(clientObject.getGovernanceRules(), this); - } - return governanceRules; - } - - /** - * Gets the resource collection API of Applications. - * - * @return Resource collection API of Applications. - */ - public Applications applications() { - if (this.applications == null) { - this.applications = new ApplicationsImpl(clientObject.getApplications(), this); - } - return applications; - } - - /** - * Gets the resource collection API of ApplicationOperations. It manages Application. - * - * @return Resource collection API of ApplicationOperations. - */ - public ApplicationOperations applicationOperations() { - if (this.applicationOperations == null) { - this.applicationOperations = new ApplicationOperationsImpl(clientObject.getApplicationOperations(), this); - } - return applicationOperations; - } - - /** - * Gets the resource collection API of SecurityConnectorApplications. - * - * @return Resource collection API of SecurityConnectorApplications. - */ - public SecurityConnectorApplications securityConnectorApplications() { - if (this.securityConnectorApplications == null) { - this.securityConnectorApplications - = new SecurityConnectorApplicationsImpl(clientObject.getSecurityConnectorApplications(), this); - } - return securityConnectorApplications; - } - - /** - * Gets the resource collection API of SecurityConnectorApplicationOperations. - * - * @return Resource collection API of SecurityConnectorApplicationOperations. - */ - public SecurityConnectorApplicationOperations securityConnectorApplicationOperations() { - if (this.securityConnectorApplicationOperations == null) { - this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsImpl( - clientObject.getSecurityConnectorApplicationOperations(), this); - } - return securityConnectorApplicationOperations; - } - - /** - * Gets the resource collection API of DefenderForStorages. It manages DefenderForStorageSetting. - * - * @return Resource collection API of DefenderForStorages. - */ - public DefenderForStorages defenderForStorages() { - if (this.defenderForStorages == null) { - this.defenderForStorages = new DefenderForStoragesImpl(clientObject.getDefenderForStorages(), this); - } - return defenderForStorages; - } - - /** - * Gets the resource collection API of SecurityOperators. - * - * @return Resource collection API of SecurityOperators. - */ - public SecurityOperators securityOperators() { - if (this.securityOperators == null) { - this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); - } - return securityOperators; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. - */ - public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { - if (this.sqlVulnerabilityAssessmentBaselineRules == null) { - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesImpl( - clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); - } - return sqlVulnerabilityAssessmentBaselineRules; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScans. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScans. - */ - public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { - if (this.sqlVulnerabilityAssessmentScans == null) { - this.sqlVulnerabilityAssessmentScans - = new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); - } - return sqlVulnerabilityAssessmentScans; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. - */ - public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { - if (this.sqlVulnerabilityAssessmentScanResults == null) { - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsImpl( - clientObject.getSqlVulnerabilityAssessmentScanResults(), this); - } - return sqlVulnerabilityAssessmentScanResults; - } - - /** - * Gets the resource collection API of SensitivitySettings. - * - * @return Resource collection API of SensitivitySettings. - */ - public SensitivitySettings sensitivitySettings() { - if (this.sensitivitySettings == null) { - this.sensitivitySettings = new SensitivitySettingsImpl(clientObject.getSensitivitySettings(), this); - } - return sensitivitySettings; - } - - /** - * Gets the resource collection API of HealthReports. - * - * @return Resource collection API of HealthReports. - */ - public HealthReports healthReports() { - if (this.healthReports == null) { - this.healthReports = new HealthReportsImpl(clientObject.getHealthReports(), this); - } - return healthReports; - } - - /** - * Gets the resource collection API of Automations. It manages Automation. - * - * @return Resource collection API of Automations. - */ - public Automations automations() { - if (this.automations == null) { - this.automations = new AutomationsImpl(clientObject.getAutomations(), this); - } - return automations; - } - - /** - * Gets the resource collection API of SecurityContacts. It manages SecurityContact. - * - * @return Resource collection API of SecurityContacts. - */ - public SecurityContacts securityContacts() { - if (this.securityContacts == null) { - this.securityContacts = new SecurityContactsImpl(clientObject.getSecurityContacts(), this); - } - return securityContacts; - } - - /** - * Gets the resource collection API of SecurityConnectors. It manages SecurityConnector. - * - * @return Resource collection API of SecurityConnectors. - */ - public SecurityConnectors securityConnectors() { - if (this.securityConnectors == null) { - this.securityConnectors = new SecurityConnectorsImpl(clientObject.getSecurityConnectors(), this); - } - return securityConnectors; - } - - /** - * Gets the resource collection API of AzureDevOpsOrgs. It manages AzureDevOpsOrg. - * - * @return Resource collection API of AzureDevOpsOrgs. - */ - public AzureDevOpsOrgs azureDevOpsOrgs() { - if (this.azureDevOpsOrgs == null) { - this.azureDevOpsOrgs = new AzureDevOpsOrgsImpl(clientObject.getAzureDevOpsOrgs(), this); - } - return azureDevOpsOrgs; - } - - /** - * Gets the resource collection API of AzureDevOpsProjects. It manages AzureDevOpsProject. - * - * @return Resource collection API of AzureDevOpsProjects. - */ - public AzureDevOpsProjects azureDevOpsProjects() { - if (this.azureDevOpsProjects == null) { - this.azureDevOpsProjects = new AzureDevOpsProjectsImpl(clientObject.getAzureDevOpsProjects(), this); - } - return azureDevOpsProjects; - } - - /** - * Gets the resource collection API of AzureDevOpsRepos. It manages AzureDevOpsRepository. - * - * @return Resource collection API of AzureDevOpsRepos. - */ - public AzureDevOpsRepos azureDevOpsRepos() { - if (this.azureDevOpsRepos == null) { - this.azureDevOpsRepos = new AzureDevOpsReposImpl(clientObject.getAzureDevOpsRepos(), this); - } - return azureDevOpsRepos; - } - - /** - * Gets the resource collection API of DevOpsConfigurations. - * - * @return Resource collection API of DevOpsConfigurations. - */ - public DevOpsConfigurations devOpsConfigurations() { - if (this.devOpsConfigurations == null) { - this.devOpsConfigurations = new DevOpsConfigurationsImpl(clientObject.getDevOpsConfigurations(), this); - } - return devOpsConfigurations; - } - - /** - * Gets the resource collection API of DevOpsPolicies. - * - * @return Resource collection API of DevOpsPolicies. - */ - public DevOpsPolicies devOpsPolicies() { - if (this.devOpsPolicies == null) { - this.devOpsPolicies = new DevOpsPoliciesImpl(clientObject.getDevOpsPolicies(), this); - } - return devOpsPolicies; - } - - /** - * Gets the resource collection API of DevOpsPolicyAssignments. It manages DevOpsPolicyAssignment. - * - * @return Resource collection API of DevOpsPolicyAssignments. - */ - public DevOpsPolicyAssignments devOpsPolicyAssignments() { - if (this.devOpsPolicyAssignments == null) { - this.devOpsPolicyAssignments - = new DevOpsPolicyAssignmentsImpl(clientObject.getDevOpsPolicyAssignments(), this); - } - return devOpsPolicyAssignments; - } - - /** - * Gets the resource collection API of GitHubOwners. - * - * @return Resource collection API of GitHubOwners. - */ - public GitHubOwners gitHubOwners() { - if (this.gitHubOwners == null) { - this.gitHubOwners = new GitHubOwnersImpl(clientObject.getGitHubOwners(), this); - } - return gitHubOwners; - } - - /** - * Gets the resource collection API of GitHubRepos. - * - * @return Resource collection API of GitHubRepos. - */ - public GitHubRepos gitHubRepos() { - if (this.gitHubRepos == null) { - this.gitHubRepos = new GitHubReposImpl(clientObject.getGitHubRepos(), this); - } - return gitHubRepos; - } - - /** - * Gets the resource collection API of GitLabGroups. - * - * @return Resource collection API of GitLabGroups. - */ - public GitLabGroups gitLabGroups() { - if (this.gitLabGroups == null) { - this.gitLabGroups = new GitLabGroupsImpl(clientObject.getGitLabGroups(), this); - } - return gitLabGroups; - } - - /** - * Gets the resource collection API of GitLabSubgroups. - * - * @return Resource collection API of GitLabSubgroups. - */ - public GitLabSubgroups gitLabSubgroups() { - if (this.gitLabSubgroups == null) { - this.gitLabSubgroups = new GitLabSubgroupsImpl(clientObject.getGitLabSubgroups(), this); - } - return gitLabSubgroups; - } - - /** - * Gets the resource collection API of GitLabProjects. - * - * @return Resource collection API of GitLabProjects. - */ - public GitLabProjects gitLabProjects() { - if (this.gitLabProjects == null) { - this.gitLabProjects = new GitLabProjectsImpl(clientObject.getGitLabProjects(), this); - } - return gitLabProjects; - } - - /** - * Gets the resource collection API of DevOpsOperationResults. - * - * @return Resource collection API of DevOpsOperationResults. - */ - public DevOpsOperationResults devOpsOperationResults() { - if (this.devOpsOperationResults == null) { - this.devOpsOperationResults - = new DevOpsOperationResultsImpl(clientObject.getDevOpsOperationResults(), this); - } - return devOpsOperationResults; - } - /** * Gets the resource collection API of ComplianceResults. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java deleted file mode 100644 index 4536de8753de4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (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.AlertsSuppressionRuleInner; - -/** - * An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. - */ -public interface AlertsSuppressionRulesClient { - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String alertType, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner get(String alertsSuppressionRuleName); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner update(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 alertsSuppressionRuleName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java deleted file mode 100644 index 19482d743f368..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (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.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in ApplicationOperationsClient. - */ -public interface ApplicationOperationsClient { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String applicationId); - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String applicationId, ApplicationInner application, - Context context); - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate(String applicationId, ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 applicationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java deleted file mode 100644 index a35f403f9bd84..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -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.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in ApplicationsClient. - */ -public interface ApplicationsClient { - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java deleted file mode 100644 index 385c41b9a00c2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.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.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.AutoProvisioningSettingInner; - -/** - * An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. - */ -public interface AutoProvisioningSettingsClient { - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String settingName, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoProvisioningSettingInner get(String settingName); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String settingName, AutoProvisioningSettingInner setting, - Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoProvisioningSettingInner create(String settingName, AutoProvisioningSettingInner setting); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java deleted file mode 100644 index 7d18996b5d265..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (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.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationUpdateModel; - -/** - * An instance of this class provides access to all the operations defined in AutomationsClient. - */ -public interface AutomationsClient { - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner getByResourceGroup(String resourceGroupName, String automationName); - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context); - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation); - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String automationName, - AutomationUpdateModel automation, Context context); - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner update(String resourceGroupName, String automationName, AutomationUpdateModel automation); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String automationName, Context context); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automationName); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationValidationStatusInner validate(String resourceGroupName, String automationName, - AutomationInner automation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java deleted file mode 100644 index 566832c05a501..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsOrgsClient. - */ -public interface AzureDevOpsOrgsClient { - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, Context context); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner get(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java deleted file mode 100644 index 8f0c62b567356..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsProjectsClient. - */ -public interface AzureDevOpsProjectsClient { - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, - Context context); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java deleted file mode 100644 index 0c8ef8061ae1e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsReposClient. - */ -public interface AzureDevOpsReposClient { - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName); - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java deleted file mode 100644 index a592b826901c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.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.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.ComplianceInner; - -/** - * An instance of this class provides access to all the operations defined in CompliancesClient. - */ -public interface CompliancesClient { - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String complianceName, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComplianceInner get(String scope, String complianceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java deleted file mode 100644 index 7f2e366138284..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (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.ConnectorSettingInner; - -/** - * An instance of this class provides access to all the operations defined in ConnectorsClient. - */ -public interface ConnectorsClient { - /** - * Cloud accounts connectors of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Cloud accounts connectors of a 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String connectorName, Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectorSettingInner get(String connectorName); - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String connectorName, - ConnectorSettingInner connectorSetting, Context context); - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectorSettingInner createOrUpdate(String connectorName, ConnectorSettingInner connectorSetting); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String connectorName, Context context); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 connectorName); -} 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 deleted file mode 100644 index d274216083560..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (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 custom assessment automation - * - * 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 along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String customAssessmentAutomationName, Context context); - - /** - * Gets a custom assessment automation - * - * 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); - - /** - * Creates a custom assessment automation - * - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, - String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody, - Context context); - - /** - * Creates a custom assessment automation - * - * 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); - - /** - * Deletes a custom assessment automation - * - * 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, Context context); - - /** - * Deletes a custom assessment automation - * - * 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); - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @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 deleted file mode 100644 index 74a13bec8c99f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (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 custom entity store assignment - * - * 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 along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String customEntityStoreAssignmentName, Context context); - - /** - * Gets a custom entity store assignment - * - * 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); - - /** - * Creates a custom entity store assignment - * - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, Context context); - - /** - * Creates a custom entity store assignment - * - * 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); - - /** - * Deleted a custom entity store assignment - * - * 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, - Context context); - - /** - * Deleted a custom entity store assignment - * - * 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); - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java deleted file mode 100644 index f092ddc308def..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.SettingName; - -/** - * An instance of this class provides access to all the operations defined in DefenderForStoragesClient. - */ -public interface DefenderForStoragesClient { - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, SettingName settingName, - Context context); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForStorageSettingInner get(String resourceId, SettingName settingName); - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting, Context context); - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForStorageSettingInner create(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startMalwareScanWithResponse(String resourceId, SettingName settingName, - Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MalwareScanInner startMalwareScan(String resourceId, SettingName settingName); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MalwareScanInner cancelMalwareScan(String resourceId, SettingName settingName, String scanId); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MalwareScanInner getMalwareScan(String resourceId, SettingName settingName, String scanId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java deleted file mode 100644 index 072a55b3132f0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; - -/** - * An instance of this class provides access to all the operations defined in DevOpsConfigurationsClient. - */ -public interface DevOpsConfigurationsClient { - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner get(String resourceGroupName, String securityConnectorName); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginUpdate(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginUpdate(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java deleted file mode 100644 index 104278955f2d8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.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.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.OperationStatusResultInner; - -/** - * An instance of this class provides access to all the operations defined in DevOpsOperationResultsClient. - */ -public interface DevOpsOperationResultsClient { - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context); - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner get(String resourceGroupName, String securityConnectorName, String operationResultId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsPoliciesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsPoliciesClient.java deleted file mode 100644 index e395c3b7cfbaf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsPoliciesClient.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.DevOpsPolicyInner; - -/** - * An instance of this class provides access to all the operations defined in DevOpsPoliciesClient. - */ -public interface DevOpsPoliciesClient { - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, Context context); - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyName, Context context); - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsPolicyInner get(String resourceGroupName, String securityConnectorName, String policyName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsPolicyAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsPolicyAssignmentsClient.java deleted file mode 100644 index 2c9701b130637..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsPolicyAssignmentsClient.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyAssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in DevOpsPolicyAssignmentsClient. - */ -public interface DevOpsPolicyAssignmentsClient { - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, String resourceId, Context context); - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context); - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsPolicyAssignmentInner get(String resourceGroupName, String securityConnectorName, String policyAssignmentId); - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsPolicyAssignmentInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment); - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsPolicyAssignmentInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context); - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsPolicyAssignmentInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment); - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsPolicyAssignmentInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context); - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsPolicyAssignmentInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment); - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsPolicyAssignmentInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context); - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsPolicyAssignmentInner update(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment); - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsPolicyAssignmentInner update(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - String policyAssignmentId); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java deleted file mode 100644 index 7a4c2cb6a4a40..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GitHubOwnersClient. - */ -public interface GitHubOwnersClient { - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitHubOwnerListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, String ownerName, - Context context); - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java deleted file mode 100644 index fc4eb380b972a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.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; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; - -/** - * An instance of this class provides access to all the operations defined in GitHubReposClient. - */ -public interface GitHubReposClient { - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String ownerName); - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String ownerName, - Context context); - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, Context context); - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitHubRepositoryInner get(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java deleted file mode 100644 index a20ab3e0215d0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GitLabGroupsClient. - */ -public interface GitLabGroupsClient { - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabGroupListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context); - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java deleted file mode 100644 index 9faf6c688bccf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; - -/** - * An instance of this class provides access to all the operations defined in GitLabProjectsClient. - */ -public interface GitLabProjectsClient { - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName); - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName, - Context context); - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName, Context context); - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabProjectInner get(String resourceGroupName, String securityConnectorName, String groupFQName, - String projectName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java deleted file mode 100644 index ffcc005c753ba..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GitLabSubgroupsClient. - */ -public interface GitLabSubgroupsClient { - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context); - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabGroupListResponseInner list(String resourceGroupName, String securityConnectorName, String groupFQName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java deleted file mode 100644 index bb00ad61eea32..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.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.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. - */ -public interface GovernanceAssignmentsClient { - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName); - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String assessmentName, String assignmentKey, - Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey); - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, String assessmentName, - String assignmentKey, GovernanceAssignmentInner governanceAssignment, Context context); - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner createOrUpdate(String scope, String assessmentName, String assignmentKey, - GovernanceAssignmentInner governanceAssignment); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, Context context); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String assessmentName, String assignmentKey); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java deleted file mode 100644 index a75e3e9290b69..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; - -/** - * An instance of this class provides access to all the operations defined in GovernanceRulesClient. - */ -public interface GovernanceRulesClient { - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String ruleId, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner get(String scope, String ruleId); - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, String ruleId, - GovernanceRuleInner governanceRule, Context context); - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String scope, String ruleId, Context context); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String ruleId, Context context); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginExecute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginExecute(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 execute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRulesOperationResultsResponse operationResultsWithResponse(String scope, String ruleId, - String operationId, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultAutoGeneratedInner operationResults(String scope, String ruleId, String operationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java deleted file mode 100644 index 2db32bbb22aa4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.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.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.HealthReportInner; - -/** - * An instance of this class provides access to all the operations defined in HealthReportsClient. - */ -public interface HealthReportsClient { - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String healthReportName, Context context); - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HealthReportInner get(String resourceId, String healthReportName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java deleted file mode 100644 index 4004e84aa1033..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (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.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -/** - * An instance of this class provides access to all the operations defined in InformationProtectionPoliciesClient. - */ -public interface InformationProtectionPoliciesClient { - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner get(String scope, InformationProtectionPolicyName informationProtectionPolicyName); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, Context context); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner createOrUpdate(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy); - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java deleted file mode 100644 index 3addbc8dafd4c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.AscLocationInner; - -/** - * An instance of this class provides access to all the operations defined in LocationsClient. - */ -public interface LocationsClient { - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their 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 list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ascLocation, Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AscLocationInner get(String ascLocation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java deleted file mode 100644 index 1326b7d829a95..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.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.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; - -/** - * An instance of this class provides access to all the operations defined in MdeOnboardingsClient. - */ -public interface MdeOnboardingsClient { - /** - * 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 all MDE onboarding data resources along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * 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 all MDE onboarding data resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MdeOnboardingDataListInner list(); - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MdeOnboardingDataInner get(); -} 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 deleted file mode 100644 index 3ce1a1869f471..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -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.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * Exposes all available operations for discovery purposes. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java deleted file mode 100644 index 36f7fb66f1aee..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.RegulatoryComplianceAssessmentInner; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. - */ -public interface RegulatoryComplianceAssessmentsClient { - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName); - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceAssessmentInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java deleted file mode 100644 index d5da21d079244..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.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.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.RegulatoryComplianceControlInner; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. - */ -public interface RegulatoryComplianceControlsClient { - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName); - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName, String filter, - Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceControlInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java deleted file mode 100644 index 598e1cdedbd42..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.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.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.RegulatoryComplianceStandardInner; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. - */ -public interface RegulatoryComplianceStandardsClient { - /** - * Supported regulatory compliance standards details and state. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String regulatoryComplianceStandardName, - Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceStandardInner get(String regulatoryComplianceStandardName); -} 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 5fd6a95031732..0b1eac75a8623 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 @@ -39,321 +39,6 @@ public interface SecurityCenter { */ Duration getDefaultPollInterval(); - /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. - */ - LocationsClient getLocations(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - TasksClient getTasks(); - - /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. - */ - AutoProvisioningSettingsClient getAutoProvisioningSettings(); - - /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. - */ - CompliancesClient getCompliances(); - - /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. - */ - InformationProtectionPoliciesClient getInformationProtectionPolicies(); - - /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. - */ - WorkspaceSettingsClient getWorkspaceSettings(); - - /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. - */ - AlertsSuppressionRulesClient getAlertsSuppressionRules(); - - /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. - */ - RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards(); - - /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. - */ - RegulatoryComplianceControlsClient getRegulatoryComplianceControls(); - - /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. - */ - RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments(); - - /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. - */ - SubAssessmentsClient getSubAssessments(); - - /** - * Gets the ConnectorsClient object to access its operations. - * - * @return the ConnectorsClient object. - */ - ConnectorsClient getConnectors(); - - /** - * Gets the SoftwareInventoriesClient object to access its operations. - * - * @return the SoftwareInventoriesClient object. - */ - SoftwareInventoriesClient getSoftwareInventories(); - - /** - * 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 MdeOnboardingsClient object to access its operations. - * - * @return the MdeOnboardingsClient object. - */ - MdeOnboardingsClient getMdeOnboardings(); - - /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. - */ - GovernanceAssignmentsClient getGovernanceAssignments(); - - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. - */ - GovernanceRulesClient getGovernanceRules(); - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - ApplicationsClient getApplications(); - - /** - * Gets the ApplicationOperationsClient object to access its operations. - * - * @return the ApplicationOperationsClient object. - */ - ApplicationOperationsClient getApplicationOperations(); - - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. - */ - SecurityConnectorApplicationsClient getSecurityConnectorApplications(); - - /** - * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationOperationsClient object. - */ - SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations(); - - /** - * Gets the DefenderForStoragesClient object to access its operations. - * - * @return the DefenderForStoragesClient object. - */ - DefenderForStoragesClient getDefenderForStorages(); - - /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. - */ - SecurityOperatorsClient getSecurityOperators(); - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); - - /** - * Gets the SensitivitySettingsClient object to access its operations. - * - * @return the SensitivitySettingsClient object. - */ - SensitivitySettingsClient getSensitivitySettings(); - - /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. - */ - HealthReportsClient getHealthReports(); - - /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. - */ - AutomationsClient getAutomations(); - - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. - */ - SecurityContactsClient getSecurityContacts(); - - /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. - */ - SecurityConnectorsClient getSecurityConnectors(); - - /** - * Gets the AzureDevOpsOrgsClient object to access its operations. - * - * @return the AzureDevOpsOrgsClient object. - */ - AzureDevOpsOrgsClient getAzureDevOpsOrgs(); - - /** - * Gets the AzureDevOpsProjectsClient object to access its operations. - * - * @return the AzureDevOpsProjectsClient object. - */ - AzureDevOpsProjectsClient getAzureDevOpsProjects(); - - /** - * Gets the AzureDevOpsReposClient object to access its operations. - * - * @return the AzureDevOpsReposClient object. - */ - AzureDevOpsReposClient getAzureDevOpsRepos(); - - /** - * Gets the DevOpsConfigurationsClient object to access its operations. - * - * @return the DevOpsConfigurationsClient object. - */ - DevOpsConfigurationsClient getDevOpsConfigurations(); - - /** - * Gets the DevOpsPoliciesClient object to access its operations. - * - * @return the DevOpsPoliciesClient object. - */ - DevOpsPoliciesClient getDevOpsPolicies(); - - /** - * Gets the DevOpsPolicyAssignmentsClient object to access its operations. - * - * @return the DevOpsPolicyAssignmentsClient object. - */ - DevOpsPolicyAssignmentsClient getDevOpsPolicyAssignments(); - - /** - * Gets the GitHubOwnersClient object to access its operations. - * - * @return the GitHubOwnersClient object. - */ - GitHubOwnersClient getGitHubOwners(); - - /** - * Gets the GitHubReposClient object to access its operations. - * - * @return the GitHubReposClient object. - */ - GitHubReposClient getGitHubRepos(); - - /** - * Gets the GitLabGroupsClient object to access its operations. - * - * @return the GitLabGroupsClient object. - */ - GitLabGroupsClient getGitLabGroups(); - - /** - * Gets the GitLabSubgroupsClient object to access its operations. - * - * @return the GitLabSubgroupsClient object. - */ - GitLabSubgroupsClient getGitLabSubgroups(); - - /** - * Gets the GitLabProjectsClient object to access its operations. - * - * @return the GitLabProjectsClient object. - */ - GitLabProjectsClient getGitLabProjects(); - - /** - * Gets the DevOpsOperationResultsClient object to access its operations. - * - * @return the DevOpsOperationResultsClient object. - */ - DevOpsOperationResultsClient getDevOpsOperationResults(); - /** * Gets the ComplianceResultsClient object to access its operations. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java deleted file mode 100644 index 8a5151b952815..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (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.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorApplicationOperationsClient. - */ -public interface SecurityConnectorApplicationOperationsClient { - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String resourceGroupName, String securityConnectorName, String applicationId); - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application, Context context); - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate(String resourceGroupName, String securityConnectorName, String applicationId, - ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String securityConnectorName, String applicationId, - Context context); - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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, String applicationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java deleted file mode 100644 index fd9ab063f4d8c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.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.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.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. - */ -public interface SecurityConnectorApplicationsClient { - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} 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 deleted file mode 100644 index c213bebdc82b5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String securityConnectorName, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(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); - - /** - * 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String securityConnectorName, 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); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java deleted file mode 100644 index ed6a348f7243b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContactName; - -/** - * An instance of this class provides access to all the operations defined in SecurityContactsClient. - */ -public interface SecurityContactsClient { - /** - * List all security contact configurations for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(SecurityContactName securityContactName, Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner get(SecurityContactName securityContactName); - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(SecurityContactName securityContactName, - SecurityContactInner securityContact, Context context); - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner create(SecurityContactName securityContactName, SecurityContactInner securityContact); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(SecurityContactName securityContactName, Context context); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(SecurityContactName securityContactName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java deleted file mode 100644 index 1971f46dd42ef..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (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.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityOperatorsClient. - */ -public interface SecurityOperatorsClient { - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String pricingName, Context context); - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorListInner list(String pricingName); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorInner get(String pricingName, String securityOperatorName); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 operator under a given subscription and pricing along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, - Context context); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 operator under a given subscription and pricing. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorInner createOrUpdate(String pricingName, String securityOperatorName); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 pricingName, String securityOperatorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java deleted file mode 100644 index 3a777e018198c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.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.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; - -/** - * An instance of this class provides access to all the operations defined in SensitivitySettingsClient. - */ -public interface SensitivitySettingsClient { - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - createOrUpdateWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context); - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetSensitivitySettingsResponseInner createOrUpdate(UpdateSensitivitySettingsRequest sensitivitySettings); - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetSensitivitySettingsResponseInner get(); - - /** - * Gets a list with a single sensitivity settings resource. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetSensitivitySettingsListResponseInner list(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java index 18ef6bb2b741e..f1bb9a7bd7409 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java @@ -10,7 +10,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; +import com.azure.resourcemanager.security.models.SettingName; /** * An instance of this class provides access to all the operations defined in SettingsClient. @@ -49,7 +49,7 @@ public interface SettingsClient { * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(SettingNameAutoGenerated settingName, Context context); + Response getWithResponse(SettingName settingName, Context context); /** * Settings of different configurations in Microsoft Defender for Cloud. @@ -61,7 +61,7 @@ public interface SettingsClient { * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner get(SettingNameAutoGenerated settingName); + SettingInner get(SettingName settingName); /** * updating settings about different configurations in Microsoft Defender for Cloud. @@ -75,8 +75,7 @@ public interface SettingsClient { * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(SettingNameAutoGenerated settingName, SettingInner setting, - Context context); + Response updateWithResponse(SettingName settingName, SettingInner setting, Context context); /** * updating settings about different configurations in Microsoft Defender for Cloud. @@ -89,5 +88,5 @@ Response updateWithResponse(SettingNameAutoGenerated settingName, * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner update(SettingNameAutoGenerated settingName, SettingInner setting); + SettingInner update(SettingName settingName, SettingInner setting); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java deleted file mode 100644 index 44c87aa6b3438..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.SoftwareInner; - -/** - * An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. - */ -public interface SoftwareInventoriesClient { - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name 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 the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName); - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context); - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 software data of the virtual machine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName, String softwareName, Context context); - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 software data of the virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SoftwareInner get(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, - String softwareName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java deleted file mode 100644 index 4ddb2758ac869..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (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.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RulesResultsInput; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentBaselineRulesClient. - */ -public interface SqlVulnerabilityAssessmentBaselineRulesClient { - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String ruleId, String workspaceId, String resourceId, - RuleResultsInput body, Context context); - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 rule results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RuleResultsInner createOrUpdate(String ruleId, String workspaceId, String resourceId); - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ruleId, String workspaceId, String resourceId, Context context); - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 the results for a given rule in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RuleResultsInner get(String ruleId, String workspaceId, String resourceId); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String ruleId, String workspaceId, String resourceId); - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String workspaceId, String resourceId, Context context); - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @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 the results for all rules in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RulesResultsInner list(String workspaceId, String resourceId); - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 rules results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addWithResponse(String workspaceId, String resourceId, RulesResultsInput body, - Context context); - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @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 a list of rules results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RulesResultsInner add(String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java deleted file mode 100644 index c669c0462cd7b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.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.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.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentScanResultsClient. - */ -public interface SqlVulnerabilityAssessmentScanResultsClient { - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scanId, String scanResultId, String workspaceId, String resourceId, - Context context); - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @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 the scan results of a single rule in a scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanResultInner get(String scanId, String scanResultId, String workspaceId, String resourceId); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scanId, String workspaceId, String resourceId, Context context); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @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 a list of scan results for a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanResultsInner list(String scanId, String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java deleted file mode 100644 index d87cdc9a55830..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.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.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.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; - -/** - * An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. - */ -public interface SqlVulnerabilityAssessmentScansClient { - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context); - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @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 the scan details of a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanInner get(String scanId, String workspaceId, String resourceId); - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String workspaceId, String resourceId, Context context); - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @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 a list of scan records. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScansInner list(String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java deleted file mode 100644 index 4c3cc7e17d9d7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.SecuritySubAssessmentInner; - -/** - * An instance of this class provides access to all the operations defined in SubAssessmentsClient. - */ -public interface SubAssessmentsClient { - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(String scope); - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(String scope, Context context); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String assessmentName, String subAssessmentName, - Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySubAssessmentInner get(String scope, String assessmentName, String subAssessmentName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java deleted file mode 100644 index 5e45193f7e01e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (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.SecurityTaskInner; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; - -/** - * An instance of this class provides access to all the operations defined in TasksClient. - */ -public interface TasksClient { - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws com.azure.core.management.exception.ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, - Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelTaskStateWithResponse(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelTaskState(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation, String filter, - Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, String ascLocation, - String taskName, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelTaskStateWithResponse(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java deleted file mode 100644 index 246993e8efde6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (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.WorkspaceSettingInner; - -/** - * An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. - */ -public interface WorkspaceSettingsClient { - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String workspaceSettingName, Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner get(String workspaceSettingName); - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context); - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettingInner workspaceSetting); - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context); - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettingInner workspaceSetting); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String workspaceSettingName, Context context); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String workspaceSettingName); -} 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 deleted file mode 100644 index b82361145a2d1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes the suppression rule. - */ -@Fluent -public final class AlertsSuppressionRuleInner extends ProxyResource { - /* - * describes AlertsSuppressionRule properties - */ - private AlertsSuppressionRuleProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AlertsSuppressionRuleInner class. - */ - public AlertsSuppressionRuleInner() { - } - - /** - * Get the innerProperties property: describes AlertsSuppressionRule properties. - * - * @return the innerProperties value. - */ - private AlertsSuppressionRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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.innerProperties() == null ? null : this.innerProperties().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 AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withAlertType(String alertType) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withAlertType(alertType); - return this; - } - - /** - * Get the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); - } - - /** - * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @return the expirationDateUtc value. - */ - public OffsetDateTime expirationDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().expirationDateUtc(); - } - - /** - * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @param expirationDateUtc the expirationDateUtc value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expirationDateUtc) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withExpirationDateUtc(expirationDateUtc); - return this; - } - - /** - * Get the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - public String reason() { - return this.innerProperties() == null ? null : this.innerProperties().reason(); - } - - /** - * Set the reason property: The reason for dismissing the alert. - * - * @param reason the reason value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withReason(String reason) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withReason(reason); - return this; - } - - /** - * Get the state property: Possible states of the rule. - * - * @return the state value. - */ - public RuleState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Possible states of the rule. - * - * @param state the state value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withState(RuleState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - public String comment() { - return this.innerProperties() == null ? null : this.innerProperties().comment(); - } - - /** - * Set the comment property: Any comment regarding the rule. - * - * @param comment the comment value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withComment(String comment) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withComment(comment); - return this; - } - - /** - * Get the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - public SuppressionAlertsScope suppressionAlertsScope() { - return this.innerProperties() == null ? null : this.innerProperties().suppressionAlertsScope(); - } - - /** - * Set the suppressionAlertsScope property: The suppression conditions. - * - * @param suppressionAlertsScope the suppressionAlertsScope value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withSuppressionAlertsScope(suppressionAlertsScope); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertsSuppressionRuleInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertsSuppressionRuleInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AlertsSuppressionRuleInner. - */ - public static AlertsSuppressionRuleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertsSuppressionRuleInner deserializedAlertsSuppressionRuleInner = new AlertsSuppressionRuleInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.innerProperties - = AlertsSuppressionRuleProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertsSuppressionRuleInner; - }); - } -} 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 deleted file mode 100644 index b7d82f67d8ea8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * describes AlertsSuppressionRule properties. - */ -@Fluent -public final class AlertsSuppressionRuleProperties implements JsonSerializable { - /* - * Type of the alert to automatically suppress. For all alert types, use '*' - */ - private String alertType; - - /* - * The last time this rule was modified - */ - private OffsetDateTime lastModifiedUtc; - - /* - * Expiration date of the rule, if value is not provided or provided as null there will no expiration at all - */ - private OffsetDateTime expirationDateUtc; - - /* - * The reason for dismissing the alert - */ - private String reason; - - /* - * Possible states of the rule - */ - private RuleState state; - - /* - * Any comment regarding the rule - */ - private String comment; - - /* - * The suppression conditions - */ - private SuppressionAlertsScope suppressionAlertsScope; - - /** - * Creates an instance of AlertsSuppressionRuleProperties class. - */ - public AlertsSuppressionRuleProperties() { - } - - /** - * 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 - * there will no expiration at all. - * - * @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 - * there will no expiration at all. - * - * @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.atError() - .log(new IllegalArgumentException( - "Missing required property alertType in model AlertsSuppressionRuleProperties")); - } - if (reason() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property reason in model AlertsSuppressionRuleProperties")); - } - if (state() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property state in model AlertsSuppressionRuleProperties")); - } - if (suppressionAlertsScope() != null) { - suppressionAlertsScope().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRuleProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("alertType", this.alertType); - jsonWriter.writeStringField("reason", this.reason); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - jsonWriter.writeStringField("expirationDateUtc", - this.expirationDateUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateUtc)); - jsonWriter.writeStringField("comment", this.comment); - jsonWriter.writeJsonField("suppressionAlertsScope", this.suppressionAlertsScope); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertsSuppressionRuleProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertsSuppressionRuleProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AlertsSuppressionRuleProperties. - */ - public static AlertsSuppressionRuleProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertsSuppressionRuleProperties deserializedAlertsSuppressionRuleProperties - = new AlertsSuppressionRuleProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("alertType".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.alertType = reader.getString(); - } else if ("reason".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.reason = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.state = RuleState.fromString(reader.getString()); - } else if ("lastModifiedUtc".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.lastModifiedUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("expirationDateUtc".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.expirationDateUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("comment".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.comment = reader.getString(); - } else if ("suppressionAlertsScope".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.suppressionAlertsScope - = SuppressionAlertsScope.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertsSuppressionRuleProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java deleted file mode 100644 index 15d33f5044d47..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.List; - -/** - * Security Application over a given scope. - */ -@Fluent -public final class ApplicationInner extends ProxyResource { - /* - * Properties of a security application - */ - private ApplicationProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ApplicationInner class. - */ - public ApplicationInner() { - } - - /** - * Get the innerProperties property: Properties of a security application. - * - * @return the innerProperties value. - */ - private ApplicationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the displayName property: display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: description of the application. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: description of the application. - * - * @param description the description value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public ApplicationSourceResourceType sourceResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().sourceResourceType(); - } - - /** - * Set the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withSourceResourceType(sourceResourceType); - return this; - } - - /** - * Get the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.innerProperties() == null ? null : this.innerProperties().conditionSets(); - } - - /** - * Set the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withConditionSets(List conditionSets) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withConditionSets(conditionSets); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ApplicationInner. - */ - public static ApplicationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationInner deserializedApplicationInner = new ApplicationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedApplicationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedApplicationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedApplicationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedApplicationInner.innerProperties = ApplicationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java deleted file mode 100644 index 1945a5b0e02e0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of an application. - */ -@Fluent -public final class ApplicationProperties implements JsonSerializable { - /* - * display name of the application - */ - private String displayName; - - /* - * description of the application - */ - private String description; - - /* - * The application source, what it affects, e.g. Assessments - */ - private ApplicationSourceResourceType sourceResourceType; - - /* - * The application conditionSets - see examples - */ - private List conditionSets; - - /** - * Creates an instance of ApplicationProperties class. - */ - public ApplicationProperties() { - } - - /** - * Get the displayName property: display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: description of the application. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: description of the application. - * - * @param description the description value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public ApplicationSourceResourceType sourceResourceType() { - return this.sourceResourceType; - } - - /** - * Set the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - this.sourceResourceType = sourceResourceType; - return this; - } - - /** - * Get the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.conditionSets; - } - - /** - * Set the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withConditionSets(List conditionSets) { - this.conditionSets = conditionSets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceResourceType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sourceResourceType in model ApplicationProperties")); - } - if (conditionSets() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property conditionSets in model ApplicationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceResourceType", - this.sourceResourceType == null ? null : this.sourceResourceType.toString()); - jsonWriter.writeArrayField("conditionSets", this.conditionSets, - (writer, element) -> writer.writeUntyped(element)); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ApplicationProperties. - */ - public static ApplicationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationProperties deserializedApplicationProperties = new ApplicationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceResourceType".equals(fieldName)) { - deserializedApplicationProperties.sourceResourceType - = ApplicationSourceResourceType.fromString(reader.getString()); - } else if ("conditionSets".equals(fieldName)) { - List conditionSets = reader.readArray(reader1 -> reader1.readUntyped()); - deserializedApplicationProperties.conditionSets = conditionSets; - } else if ("displayName".equals(fieldName)) { - deserializedApplicationProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedApplicationProperties.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java deleted file mode 100644 index 8293bd0662fd4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ASC location of the subscription is in the "name" field. - */ -@Fluent -public final class AscLocationInner extends ProxyResource { - /* - * An empty set of properties - */ - private Object properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AscLocationInner class. - */ - public AscLocationInner() { - } - - /** - * Get the properties property: An empty set of properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: An empty set of properties. - * - * @param properties the properties value to set. - * @return the AscLocationInner object itself. - */ - public AscLocationInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeUntypedField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AscLocationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AscLocationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AscLocationInner. - */ - public static AscLocationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AscLocationInner deserializedAscLocationInner = new AscLocationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAscLocationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAscLocationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAscLocationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAscLocationInner.properties = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedAscLocationInner; - }); - } -} 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 deleted file mode 100644 index 0b5606d538319..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AutoProvision; -import java.io.IOException; - -/** - * Auto provisioning setting. - */ -@Fluent -public final class AutoProvisioningSettingInner extends ProxyResource { - /* - * Auto provisioning setting data - */ - private AutoProvisioningSettingProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AutoProvisioningSettingInner class. - */ - public AutoProvisioningSettingInner() { - } - - /** - * Get the innerProperties property: Auto provisioning setting data. - * - * @return the innerProperties value. - */ - private AutoProvisioningSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - public AutoProvision autoProvision() { - return this.innerProperties() == null ? null : this.innerProperties().autoProvision(); - } - - /** - * Set the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision the autoProvision value to set. - * @return the AutoProvisioningSettingInner object itself. - */ - public AutoProvisioningSettingInner withAutoProvision(AutoProvision autoProvision) { - if (this.innerProperties() == null) { - this.innerProperties = new AutoProvisioningSettingProperties(); - } - this.innerProperties().withAutoProvision(autoProvision); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutoProvisioningSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutoProvisioningSettingInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AutoProvisioningSettingInner. - */ - public static AutoProvisioningSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutoProvisioningSettingInner deserializedAutoProvisioningSettingInner = new AutoProvisioningSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.innerProperties - = AutoProvisioningSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAutoProvisioningSettingInner; - }); - } -} 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 deleted file mode 100644 index 8919653efa8cb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AutoProvision; -import java.io.IOException; - -/** - * describes properties of an auto provisioning setting. - */ -@Fluent -public final class AutoProvisioningSettingProperties implements JsonSerializable { - /* - * Describes what kind of security agent provisioning action to take - */ - private AutoProvision autoProvision; - - /** - * Creates an instance of AutoProvisioningSettingProperties class. - */ - public AutoProvisioningSettingProperties() { - } - - /** - * 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.atError() - .log(new IllegalArgumentException( - "Missing required property autoProvision in model AutoProvisioningSettingProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutoProvisioningSettingProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("autoProvision", this.autoProvision == null ? null : this.autoProvision.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutoProvisioningSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutoProvisioningSettingProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AutoProvisioningSettingProperties. - */ - public static AutoProvisioningSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutoProvisioningSettingProperties deserializedAutoProvisioningSettingProperties - = new AutoProvisioningSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("autoProvision".equals(fieldName)) { - deserializedAutoProvisioningSettingProperties.autoProvision - = AutoProvision.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAutoProvisioningSettingProperties; - }); - } -} 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 deleted file mode 100644 index e34ac40396a3c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The security automation resource. - */ -@Fluent -public final class AutomationInner extends Resource { - /* - * Security automation data - */ - private AutomationProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AutomationInner class. - */ - public AutomationInner() { - } - - /** - * Get the innerProperties property: Security automation data. - * - * @return the innerProperties value. - */ - private AutomationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public AutomationInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AutomationInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withIsEnabled(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.innerProperties() == null ? null : this.innerProperties().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 AutomationInner object itself. - */ - public AutomationInner withScopes(List scopes) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withScopes(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.innerProperties() == null ? null : this.innerProperties().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 AutomationInner object itself. - */ - public AutomationInner withSources(List sources) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withSources(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.innerProperties() == null ? null : this.innerProperties().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 AutomationInner object itself. - */ - public AutomationInner withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AutomationInner. - */ - public static AutomationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationInner deserializedAutomationInner = new AutomationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAutomationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAutomationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAutomationInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedAutomationInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAutomationInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedAutomationInner.innerProperties = AutomationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationInner; - }); - } -} 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 deleted file mode 100644 index 4fba434b798ff..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import java.io.IOException; -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 implements JsonSerializable { - /* - * The security automation description. - */ - private String description; - - /* - * Indicates whether the security automation is enabled. - */ - 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. - */ - private List scopes; - - /* - * A collection of the source event types which evaluate the security automation set of rules. - */ - 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. - */ - private List actions; - - /** - * Creates an instance of AutomationProperties class. - */ - public AutomationProperties() { - } - - /** - * 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationProperties. - */ - public static AutomationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationProperties deserializedAutomationProperties = new AutomationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAutomationProperties.description = reader.getString(); - } else if ("isEnabled".equals(fieldName)) { - deserializedAutomationProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("scopes".equals(fieldName)) { - List scopes = reader.readArray(reader1 -> AutomationScope.fromJson(reader1)); - deserializedAutomationProperties.scopes = scopes; - } else if ("sources".equals(fieldName)) { - List sources = reader.readArray(reader1 -> AutomationSource.fromJson(reader1)); - deserializedAutomationProperties.sources = sources; - } else if ("actions".equals(fieldName)) { - List actions = reader.readArray(reader1 -> AutomationAction.fromJson(reader1)); - deserializedAutomationProperties.actions = actions; - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java deleted file mode 100644 index 8d5aaeebcd880..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The security automation model state property bag. - */ -@Fluent -public final class AutomationValidationStatusInner implements JsonSerializable { - /* - * Indicates whether the model is valid or not. - */ - private Boolean isValid; - - /* - * The validation message. - */ - private String message; - - /** - * Creates an instance of AutomationValidationStatusInner class. - */ - public AutomationValidationStatusInner() { - } - - /** - * Get the isValid property: Indicates whether the model is valid or not. - * - * @return the isValid value. - */ - public Boolean isValid() { - return this.isValid; - } - - /** - * Set the isValid property: Indicates whether the model is valid or not. - * - * @param isValid the isValid value to set. - * @return the AutomationValidationStatusInner object itself. - */ - public AutomationValidationStatusInner withIsValid(Boolean isValid) { - this.isValid = isValid; - return this; - } - - /** - * Get the message property: The validation message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The validation message. - * - * @param message the message value to set. - * @return the AutomationValidationStatusInner object itself. - */ - public AutomationValidationStatusInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isValid", this.isValid); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationValidationStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationValidationStatusInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationValidationStatusInner. - */ - public static AutomationValidationStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationValidationStatusInner deserializedAutomationValidationStatusInner - = new AutomationValidationStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isValid".equals(fieldName)) { - deserializedAutomationValidationStatusInner.isValid = reader.getNullable(JsonReader::getBoolean); - } else if ("message".equals(fieldName)) { - deserializedAutomationValidationStatusInner.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationValidationStatusInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java deleted file mode 100644 index 3e18099712046..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; -import java.io.IOException; - -/** - * Azure DevOps Organization resource. - */ -@Fluent -public final class AzureDevOpsOrgInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * Azure DevOps Organization properties. - */ - private AzureDevOpsOrgProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AzureDevOpsOrgInner class. - */ - public AzureDevOpsOrgInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: Azure DevOps Organization properties. - * - * @return the properties value. - */ - public AzureDevOpsOrgProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Azure DevOps Organization properties. - * - * @param properties the properties value to set. - * @return the AzureDevOpsOrgInner object itself. - */ - public AzureDevOpsOrgInner withProperties(AzureDevOpsOrgProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsOrgInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsOrgInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AzureDevOpsOrgInner. - */ - public static AzureDevOpsOrgInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsOrgInner deserializedAzureDevOpsOrgInner = new AzureDevOpsOrgInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.properties = AzureDevOpsOrgProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsOrgInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java deleted file mode 100644 index d1108a13c7316..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class AzureDevOpsOrgListResponseInner implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of AzureDevOpsOrgListResponseInner class. - */ - public AzureDevOpsOrgListResponseInner() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the AzureDevOpsOrgListResponseInner object itself. - */ - public AzureDevOpsOrgListResponseInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the AzureDevOpsOrgListResponseInner object itself. - */ - public AzureDevOpsOrgListResponseInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsOrgListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsOrgListResponseInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsOrgListResponseInner. - */ - public static AzureDevOpsOrgListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsOrgListResponseInner deserializedAzureDevOpsOrgListResponseInner - = new AzureDevOpsOrgListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureDevOpsOrgInner.fromJson(reader1)); - deserializedAzureDevOpsOrgListResponseInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAzureDevOpsOrgListResponseInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsOrgListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java deleted file mode 100644 index 0bb3e8f5dfc5d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; -import java.io.IOException; - -/** - * Azure DevOps Project resource. - */ -@Fluent -public final class AzureDevOpsProjectInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * Azure DevOps Project properties. - */ - private AzureDevOpsProjectProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AzureDevOpsProjectInner class. - */ - public AzureDevOpsProjectInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: Azure DevOps Project properties. - * - * @return the properties value. - */ - public AzureDevOpsProjectProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Azure DevOps Project properties. - * - * @param properties the properties value to set. - * @return the AzureDevOpsProjectInner object itself. - */ - public AzureDevOpsProjectInner withProperties(AzureDevOpsProjectProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsProjectInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsProjectInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AzureDevOpsProjectInner. - */ - public static AzureDevOpsProjectInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsProjectInner deserializedAzureDevOpsProjectInner = new AzureDevOpsProjectInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.properties = AzureDevOpsProjectProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsProjectInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java deleted file mode 100644 index 9af9eb9f0ce47..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; -import java.io.IOException; - -/** - * Azure DevOps Repository resource. - */ -@Fluent -public final class AzureDevOpsRepositoryInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * Azure DevOps Repository properties. - */ - private AzureDevOpsRepositoryProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AzureDevOpsRepositoryInner class. - */ - public AzureDevOpsRepositoryInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: Azure DevOps Repository properties. - * - * @return the properties value. - */ - public AzureDevOpsRepositoryProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Azure DevOps Repository properties. - * - * @param properties the properties value to set. - * @return the AzureDevOpsRepositoryInner object itself. - */ - public AzureDevOpsRepositoryInner withProperties(AzureDevOpsRepositoryProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsRepositoryInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsRepositoryInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AzureDevOpsRepositoryInner. - */ - public static AzureDevOpsRepositoryInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsRepositoryInner deserializedAzureDevOpsRepositoryInner = new AzureDevOpsRepositoryInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.properties - = AzureDevOpsRepositoryProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsRepositoryInner; - }); - } -} 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 deleted file mode 100644 index 4a7e8c4e1d198..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Compliance of a scope. - */ -@Immutable -public final class ComplianceInner extends ProxyResource { - /* - * Compliance data - */ - private ComplianceProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ComplianceInner class. - */ - public ComplianceInner() { - } - - /** - * Get the innerProperties property: Compliance data. - * - * @return the innerProperties value. - */ - private ComplianceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - public OffsetDateTime assessmentTimestampUtcDate() { - return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().assessmentResult(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComplianceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ComplianceInner. - */ - public static ComplianceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceInner deserializedComplianceInner = new ComplianceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedComplianceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedComplianceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedComplianceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedComplianceInner.innerProperties = ComplianceProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceInner; - }); - } -} 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 deleted file mode 100644 index 3e0378f146698..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import java.io.IOException; -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 implements JsonSerializable { - /* - * The timestamp when the Compliance calculation was conducted. - */ - private OffsetDateTime assessmentTimestampUtcDate; - - /* - * The resource count of the given subscription for which the Compliance calculation was conducted (needed for - * Management Group Compliance calculation). - */ - private Integer resourceCount; - - /* - * An array of segment, which is the actually the compliance assessment. - */ - private List assessmentResult; - - /** - * Creates an instance of ComplianceProperties class. - */ - public ComplianceProperties() { - } - - /** - * 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComplianceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ComplianceProperties. - */ - public static ComplianceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceProperties deserializedComplianceProperties = new ComplianceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessmentTimestampUtcDate".equals(fieldName)) { - deserializedComplianceProperties.assessmentTimestampUtcDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("resourceCount".equals(fieldName)) { - deserializedComplianceProperties.resourceCount = reader.getNullable(JsonReader::getInt); - } else if ("assessmentResult".equals(fieldName)) { - List assessmentResult - = reader.readArray(reader1 -> ComplianceSegment.fromJson(reader1)); - deserializedComplianceProperties.assessmentResult = assessmentResult; - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceProperties; - }); - } -} 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 deleted file mode 100644 index 3f6bb6260ff74..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import java.io.IOException; - -/** - * The connector setting. - */ -@Fluent -public final class ConnectorSettingInner extends ProxyResource { - /* - * Connector setting data - */ - private ConnectorSettingProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ConnectorSettingInner class. - */ - public ConnectorSettingInner() { - } - - /** - * Get the innerProperties property: Connector setting data. - * - * @return the innerProperties value. - */ - private ConnectorSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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.innerProperties() == null ? null : this.innerProperties().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 ConnectorSettingInner object itself. - */ - public ConnectorSettingInner withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectorSettingProperties(); - } - this.innerProperties().withHybridComputeSettings(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.innerProperties() == null ? null : this.innerProperties().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 ConnectorSettingInner object itself. - */ - public ConnectorSettingInner withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectorSettingProperties(); - } - this.innerProperties().withAuthenticationDetails(authenticationDetails); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectorSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectorSettingInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ConnectorSettingInner. - */ - public static ConnectorSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectorSettingInner deserializedConnectorSettingInner = new ConnectorSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedConnectorSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedConnectorSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedConnectorSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedConnectorSettingInner.innerProperties = ConnectorSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectorSettingInner; - }); - } -} 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 deleted file mode 100644 index 82e8a69213852..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import java.io.IOException; - -/** - * Describes properties of a connector setting. - */ -@Fluent -public final class ConnectorSettingProperties implements JsonSerializable { - /* - * Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute). - */ - private HybridComputeSettingsProperties hybridComputeSettings; - - /* - * Settings for authentication management, these settings are relevant only for the cloud connector. - */ - private AuthenticationDetailsProperties authenticationDetails; - - /** - * Creates an instance of ConnectorSettingProperties class. - */ - public ConnectorSettingProperties() { - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("hybridComputeSettings", this.hybridComputeSettings); - jsonWriter.writeJsonField("authenticationDetails", this.authenticationDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectorSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectorSettingProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ConnectorSettingProperties. - */ - public static ConnectorSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectorSettingProperties deserializedConnectorSettingProperties = new ConnectorSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("hybridComputeSettings".equals(fieldName)) { - deserializedConnectorSettingProperties.hybridComputeSettings - = HybridComputeSettingsProperties.fromJson(reader); - } else if ("authenticationDetails".equals(fieldName)) { - deserializedConnectorSettingProperties.authenticationDetails - = AuthenticationDetailsProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectorSettingProperties; - }); - } -} 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 deleted file mode 100644 index ee2f035c6a23b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import java.io.IOException; - -/** - * Custom Assessment Automation. - */ -@Fluent -public final class CustomAssessmentAutomationInner extends ProxyResource { - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * describes Custom Assessment Automation properties. - */ - private CustomAssessmentAutomationProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CustomAssessmentAutomationInner class. - */ - public CustomAssessmentAutomationInner() { - } - - /** - * 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomAssessmentAutomationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomAssessmentAutomationInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CustomAssessmentAutomationInner. - */ - public static CustomAssessmentAutomationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomAssessmentAutomationInner deserializedCustomAssessmentAutomationInner - = new CustomAssessmentAutomationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCustomAssessmentAutomationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCustomAssessmentAutomationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCustomAssessmentAutomationInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedCustomAssessmentAutomationInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedCustomAssessmentAutomationInner.innerProperties - = CustomAssessmentAutomationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomAssessmentAutomationInner; - }); - } -} 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 deleted file mode 100644 index b4b88b60b16bc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import java.io.IOException; - -/** - * describes the Custom Assessment Automation properties. - */ -@Fluent -public final class CustomAssessmentAutomationProperties - implements JsonSerializable { - /* - * GZip encoded KQL query representing the assessment automation results required. - */ - private String compressedQuery; - - /* - * Relevant cloud for the custom assessment automation. - */ - private SupportedCloudEnum supportedCloud = SupportedCloudEnum.AWS; - - /* - * The severity to relate to the assessments generated by this assessment automation. - */ - private SeverityEnum severity = SeverityEnum.LOW; - - /* - * The display name of the assessments generated by this assessment automation. - */ - private String displayName; - - /* - * The description to relate to the assessments generated by this assessment automation. - */ - private String description; - - /* - * The remediation description to relate to the assessments generated by this assessment automation. - */ - private String remediationDescription; - - /* - * The assessment metadata key used when an assessment is generated for this assessment automation. - */ - private String assessmentKey; - - /** - * Creates an instance of CustomAssessmentAutomationProperties class. - */ - public CustomAssessmentAutomationProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("compressedQuery", this.compressedQuery); - jsonWriter.writeStringField("supportedCloud", - this.supportedCloud == null ? null : this.supportedCloud.toString()); - jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("remediationDescription", this.remediationDescription); - jsonWriter.writeStringField("assessmentKey", this.assessmentKey); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomAssessmentAutomationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomAssessmentAutomationProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomAssessmentAutomationProperties. - */ - public static CustomAssessmentAutomationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomAssessmentAutomationProperties deserializedCustomAssessmentAutomationProperties - = new CustomAssessmentAutomationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("compressedQuery".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.compressedQuery = reader.getString(); - } else if ("supportedCloud".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.supportedCloud - = SupportedCloudEnum.fromString(reader.getString()); - } else if ("severity".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.severity - = SeverityEnum.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.description = reader.getString(); - } else if ("remediationDescription".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.remediationDescription = reader.getString(); - } else if ("assessmentKey".equals(fieldName)) { - deserializedCustomAssessmentAutomationProperties.assessmentKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomAssessmentAutomationProperties; - }); - } -} 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 deleted file mode 100644 index e718ed78ee268..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import java.io.IOException; - -/** - * describes the Custom Assessment Automation properties. - */ -@Fluent -public final class CustomAssessmentAutomationRequestProperties - implements JsonSerializable { - /* - * Base 64 encoded KQL query representing the assessment automation results required. - */ - private String compressedQuery; - - /* - * Relevant cloud for the custom assessment automation. - */ - private SupportedCloudEnum supportedCloud = SupportedCloudEnum.AWS; - - /* - * The severity to relate to the assessments generated by this assessment automation. - */ - private SeverityEnum severity = SeverityEnum.LOW; - - /* - * The display name of the assessments generated by this assessment automation. - */ - private String displayName; - - /* - * The description to relate to the assessments generated by this assessment automation. - */ - private String description; - - /* - * The remediation description to relate to the assessments generated by this assessment automation. - */ - private String remediationDescription; - - /** - * Creates an instance of CustomAssessmentAutomationRequestProperties class. - */ - public CustomAssessmentAutomationRequestProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("compressedQuery", this.compressedQuery); - jsonWriter.writeStringField("supportedCloud", - this.supportedCloud == null ? null : this.supportedCloud.toString()); - jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("remediationDescription", this.remediationDescription); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomAssessmentAutomationRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomAssessmentAutomationRequestProperties if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomAssessmentAutomationRequestProperties. - */ - public static CustomAssessmentAutomationRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomAssessmentAutomationRequestProperties deserializedCustomAssessmentAutomationRequestProperties - = new CustomAssessmentAutomationRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("compressedQuery".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequestProperties.compressedQuery = reader.getString(); - } else if ("supportedCloud".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequestProperties.supportedCloud - = SupportedCloudEnum.fromString(reader.getString()); - } else if ("severity".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequestProperties.severity - = SeverityEnum.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequestProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequestProperties.description = reader.getString(); - } else if ("remediationDescription".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequestProperties.remediationDescription = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomAssessmentAutomationRequestProperties; - }); - } -} 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 deleted file mode 100644 index 2cc3ca2fa5bc8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Custom entity store assignment. - */ -@Fluent -public final class CustomEntityStoreAssignmentInner extends ProxyResource { - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * describes custom entity store assignment properties. - */ - private CustomEntityStoreAssignmentProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CustomEntityStoreAssignmentInner class. - */ - public CustomEntityStoreAssignmentInner() { - } - - /** - * 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomEntityStoreAssignmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomEntityStoreAssignmentInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CustomEntityStoreAssignmentInner. - */ - public static CustomEntityStoreAssignmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomEntityStoreAssignmentInner deserializedCustomEntityStoreAssignmentInner - = new CustomEntityStoreAssignmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentInner.innerProperties - = CustomEntityStoreAssignmentProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomEntityStoreAssignmentInner; - }); - } -} 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 deleted file mode 100644 index c45fd7b558e52..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * describes the custom entity store assignment properties. - */ -@Fluent -public final class CustomEntityStoreAssignmentProperties - implements JsonSerializable { - /* - * The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] - */ - private String principal; - - /* - * The link to entity store database. - */ - private String entityStoreDatabaseLink; - - /** - * Creates an instance of CustomEntityStoreAssignmentProperties class. - */ - public CustomEntityStoreAssignmentProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("principal", this.principal); - jsonWriter.writeStringField("entityStoreDatabaseLink", this.entityStoreDatabaseLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomEntityStoreAssignmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomEntityStoreAssignmentProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomEntityStoreAssignmentProperties. - */ - public static CustomEntityStoreAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomEntityStoreAssignmentProperties deserializedCustomEntityStoreAssignmentProperties - = new CustomEntityStoreAssignmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principal".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentProperties.principal = reader.getString(); - } else if ("entityStoreDatabaseLink".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentProperties.entityStoreDatabaseLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomEntityStoreAssignmentProperties; - }); - } -} 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 deleted file mode 100644 index 9941030ada8b0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * describes properties of custom entity store assignment request. - */ -@Fluent -public final class CustomEntityStoreAssignmentRequestProperties - implements JsonSerializable { - /* - * The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: - * [AAD type]=[PrincipalObjectId];[TenantId] - */ - private String principal; - - /** - * Creates an instance of CustomEntityStoreAssignmentRequestProperties class. - */ - public CustomEntityStoreAssignmentRequestProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("principal", this.principal); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomEntityStoreAssignmentRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomEntityStoreAssignmentRequestProperties if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomEntityStoreAssignmentRequestProperties. - */ - public static CustomEntityStoreAssignmentRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomEntityStoreAssignmentRequestProperties deserializedCustomEntityStoreAssignmentRequestProperties - = new CustomEntityStoreAssignmentRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principal".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentRequestProperties.principal = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomEntityStoreAssignmentRequestProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java deleted file mode 100644 index f3ea0dc65e551..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.DefenderForStorageSettingProperties; -import java.io.IOException; - -/** - * The Defender for Storage resource. - */ -@Fluent -public final class DefenderForStorageSettingInner extends ProxyResource { - /* - * Defender for Storage resource properties. - */ - private DefenderForStorageSettingProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of DefenderForStorageSettingInner class. - */ - public DefenderForStorageSettingInner() { - } - - /** - * Get the properties property: Defender for Storage resource properties. - * - * @return the properties value. - */ - public DefenderForStorageSettingProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Defender for Storage resource properties. - * - * @param properties the properties value to set. - * @return the DefenderForStorageSettingInner object itself. - */ - public DefenderForStorageSettingInner withProperties(DefenderForStorageSettingProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForStorageSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForStorageSettingInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DefenderForStorageSettingInner. - */ - public static DefenderForStorageSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForStorageSettingInner deserializedDefenderForStorageSettingInner - = new DefenderForStorageSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.properties - = DefenderForStorageSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForStorageSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java deleted file mode 100644 index 52ea044b0ae63..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; -import java.io.IOException; - -/** - * DevOps Configuration resource. - */ -@Fluent -public final class DevOpsConfigurationInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * DevOps Configuration properties. - */ - private DevOpsConfigurationProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of DevOpsConfigurationInner class. - */ - public DevOpsConfigurationInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: DevOps Configuration properties. - * - * @return the properties value. - */ - public DevOpsConfigurationProperties properties() { - return this.properties; - } - - /** - * Set the properties property: DevOps Configuration properties. - * - * @param properties the properties value to set. - * @return the DevOpsConfigurationInner object itself. - */ - public DevOpsConfigurationInner withProperties(DevOpsConfigurationProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsConfigurationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsConfigurationInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DevOpsConfigurationInner. - */ - public static DevOpsConfigurationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsConfigurationInner deserializedDevOpsConfigurationInner = new DevOpsConfigurationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDevOpsConfigurationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDevOpsConfigurationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDevOpsConfigurationInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedDevOpsConfigurationInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDevOpsConfigurationInner.properties = DevOpsConfigurationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsConfigurationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsPolicyAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsPolicyAssignmentInner.java deleted file mode 100644 index cbcb271194bc7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsPolicyAssignmentInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignmentProperties; -import java.io.IOException; - -/** - * DevOps Policy assignment resource. - */ -@Fluent -public final class DevOpsPolicyAssignmentInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * Properties of the DevOps policy assignment resource. - */ - private DevOpsPolicyAssignmentProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of DevOpsPolicyAssignmentInner class. - */ - public DevOpsPolicyAssignmentInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: Properties of the DevOps policy assignment resource. - * - * @return the properties value. - */ - public DevOpsPolicyAssignmentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the DevOps policy assignment resource. - * - * @param properties the properties value to set. - * @return the DevOpsPolicyAssignmentInner object itself. - */ - public DevOpsPolicyAssignmentInner withProperties(DevOpsPolicyAssignmentProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyAssignmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyAssignmentInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DevOpsPolicyAssignmentInner. - */ - public static DevOpsPolicyAssignmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyAssignmentInner deserializedDevOpsPolicyAssignmentInner = new DevOpsPolicyAssignmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentInner.properties - = DevOpsPolicyAssignmentProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyAssignmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsPolicyInner.java deleted file mode 100644 index 2e9ebc6580c33..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsPolicyInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.DevOpsPolicyProperties; -import java.io.IOException; - -/** - * DevOps Policy Resource. - */ -@Fluent -public final class DevOpsPolicyInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * Policy DevOps Resource properties that contain the full definition of a DevOps policy resource. - */ - private DevOpsPolicyProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of DevOpsPolicyInner class. - */ - public DevOpsPolicyInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: Policy DevOps Resource properties that contain the full definition of a DevOps - * policy resource. - * - * @return the properties value. - */ - public DevOpsPolicyProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Policy DevOps Resource properties that contain the full definition of a DevOps - * policy resource. - * - * @param properties the properties value to set. - * @return the DevOpsPolicyInner object itself. - */ - public DevOpsPolicyInner withProperties(DevOpsPolicyProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DevOpsPolicyInner. - */ - public static DevOpsPolicyInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyInner deserializedDevOpsPolicyInner = new DevOpsPolicyInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDevOpsPolicyInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDevOpsPolicyInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDevOpsPolicyInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedDevOpsPolicyInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDevOpsPolicyInner.properties = DevOpsPolicyProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java deleted file mode 100644 index f73e8e04eb852..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A list with a single sensitivity settings resource. - */ -@Fluent -public final class GetSensitivitySettingsListResponseInner - implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /** - * Creates an instance of GetSensitivitySettingsListResponseInner class. - */ - public GetSensitivitySettingsListResponseInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the GetSensitivitySettingsListResponseInner object itself. - */ - public GetSensitivitySettingsListResponseInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GetSensitivitySettingsListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GetSensitivitySettingsListResponseInner if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GetSensitivitySettingsListResponseInner. - */ - public static GetSensitivitySettingsListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GetSensitivitySettingsListResponseInner deserializedGetSensitivitySettingsListResponseInner - = new GetSensitivitySettingsListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GetSensitivitySettingsResponseInner.fromJson(reader1)); - deserializedGetSensitivitySettingsListResponseInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedGetSensitivitySettingsListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java deleted file mode 100644 index 4ce68181ff8c5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; -import java.io.IOException; - -/** - * Data sensitivity settings for sensitive data discovery. - */ -@Fluent -public final class GetSensitivitySettingsResponseInner extends ProxyResource { - /* - * The sensitivity settings properties - */ - private GetSensitivitySettingsResponseProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GetSensitivitySettingsResponseInner class. - */ - public GetSensitivitySettingsResponseInner() { - } - - /** - * Get the properties property: The sensitivity settings properties. - * - * @return the properties value. - */ - public GetSensitivitySettingsResponseProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The sensitivity settings properties. - * - * @param properties the properties value to set. - * @return the GetSensitivitySettingsResponseInner object itself. - */ - public GetSensitivitySettingsResponseInner withProperties(GetSensitivitySettingsResponseProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GetSensitivitySettingsResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GetSensitivitySettingsResponseInner if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GetSensitivitySettingsResponseInner. - */ - public static GetSensitivitySettingsResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GetSensitivitySettingsResponseInner deserializedGetSensitivitySettingsResponseInner - = new GetSensitivitySettingsResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.properties - = GetSensitivitySettingsResponseProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGetSensitivitySettingsResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java deleted file mode 100644 index 5f2159ddd6efd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitHubOwnerProperties; -import java.io.IOException; - -/** - * GitHub Owner resource. - */ -@Fluent -public final class GitHubOwnerInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * GitHub Owner properties. - */ - private GitHubOwnerProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GitHubOwnerInner class. - */ - public GitHubOwnerInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: GitHub Owner properties. - * - * @return the properties value. - */ - public GitHubOwnerProperties properties() { - return this.properties; - } - - /** - * Set the properties property: GitHub Owner properties. - * - * @param properties the properties value to set. - * @return the GitHubOwnerInner object itself. - */ - public GitHubOwnerInner withProperties(GitHubOwnerProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GitHubOwnerInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubOwnerInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GitHubOwnerInner. - */ - public static GitHubOwnerInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubOwnerInner deserializedGitHubOwnerInner = new GitHubOwnerInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitHubOwnerInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitHubOwnerInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitHubOwnerInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedGitHubOwnerInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedGitHubOwnerInner.properties = GitHubOwnerProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubOwnerInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java deleted file mode 100644 index 7c7806276ba81..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class GitHubOwnerListResponseInner implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of GitHubOwnerListResponseInner class. - */ - public GitHubOwnerListResponseInner() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the GitHubOwnerListResponseInner object itself. - */ - public GitHubOwnerListResponseInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the GitHubOwnerListResponseInner object itself. - */ - public GitHubOwnerListResponseInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GitHubOwnerListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubOwnerListResponseInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GitHubOwnerListResponseInner. - */ - public static GitHubOwnerListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubOwnerListResponseInner deserializedGitHubOwnerListResponseInner = new GitHubOwnerListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GitHubOwnerInner.fromJson(reader1)); - deserializedGitHubOwnerListResponseInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGitHubOwnerListResponseInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubOwnerListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java deleted file mode 100644 index 3b6dd50b10d0a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitHubRepositoryProperties; -import java.io.IOException; - -/** - * GitHub Repository resource. - */ -@Fluent -public final class GitHubRepositoryInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * GitHub Repository properties. - */ - private GitHubRepositoryProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GitHubRepositoryInner class. - */ - public GitHubRepositoryInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: GitHub Repository properties. - * - * @return the properties value. - */ - public GitHubRepositoryProperties properties() { - return this.properties; - } - - /** - * Set the properties property: GitHub Repository properties. - * - * @param properties the properties value to set. - * @return the GitHubRepositoryInner object itself. - */ - public GitHubRepositoryInner withProperties(GitHubRepositoryProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GitHubRepositoryInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubRepositoryInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GitHubRepositoryInner. - */ - public static GitHubRepositoryInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubRepositoryInner deserializedGitHubRepositoryInner = new GitHubRepositoryInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitHubRepositoryInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitHubRepositoryInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitHubRepositoryInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedGitHubRepositoryInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedGitHubRepositoryInner.properties = GitHubRepositoryProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubRepositoryInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java deleted file mode 100644 index b20100ceff507..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitLabGroupProperties; -import java.io.IOException; - -/** - * GitLab Group resource. - */ -@Fluent -public final class GitLabGroupInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * GitLab Group properties. - */ - private GitLabGroupProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GitLabGroupInner class. - */ - public GitLabGroupInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: GitLab Group properties. - * - * @return the properties value. - */ - public GitLabGroupProperties properties() { - return this.properties; - } - - /** - * Set the properties property: GitLab Group properties. - * - * @param properties the properties value to set. - * @return the GitLabGroupInner object itself. - */ - public GitLabGroupInner withProperties(GitLabGroupProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GitLabGroupInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabGroupInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GitLabGroupInner. - */ - public static GitLabGroupInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabGroupInner deserializedGitLabGroupInner = new GitLabGroupInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitLabGroupInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitLabGroupInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitLabGroupInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedGitLabGroupInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedGitLabGroupInner.properties = GitLabGroupProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabGroupInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java deleted file mode 100644 index ada2800200923..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class GitLabGroupListResponseInner implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of GitLabGroupListResponseInner class. - */ - public GitLabGroupListResponseInner() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the GitLabGroupListResponseInner object itself. - */ - public GitLabGroupListResponseInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the GitLabGroupListResponseInner object itself. - */ - public GitLabGroupListResponseInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GitLabGroupListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabGroupListResponseInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GitLabGroupListResponseInner. - */ - public static GitLabGroupListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabGroupListResponseInner deserializedGitLabGroupListResponseInner = new GitLabGroupListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GitLabGroupInner.fromJson(reader1)); - deserializedGitLabGroupListResponseInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGitLabGroupListResponseInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabGroupListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java deleted file mode 100644 index 8156d2a40269e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.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.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitLabProjectProperties; -import java.io.IOException; - -/** - * GitLab Project resource. - */ -@Fluent -public final class GitLabProjectInner extends ProxyResource { - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * GitLab Project properties. - */ - private GitLabProjectProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GitLabProjectInner class. - */ - public GitLabProjectInner() { - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the properties property: GitLab Project properties. - * - * @return the properties value. - */ - public GitLabProjectProperties properties() { - return this.properties; - } - - /** - * Set the properties property: GitLab Project properties. - * - * @param properties the properties value to set. - * @return the GitLabProjectInner object itself. - */ - public GitLabProjectInner withProperties(GitLabProjectProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GitLabProjectInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabProjectInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GitLabProjectInner. - */ - public static GitLabProjectInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabProjectInner deserializedGitLabProjectInner = new GitLabProjectInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitLabProjectInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitLabProjectInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitLabProjectInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedGitLabProjectInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedGitLabProjectInner.properties = GitLabProjectProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabProjectInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java deleted file mode 100644 index fbae260e678fa..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Governance assignment over a given scope. - */ -@Fluent -public final class GovernanceAssignmentInner extends ProxyResource { - /* - * The properties of a governance assignment - */ - private GovernanceAssignmentProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GovernanceAssignmentInner class. - */ - public GovernanceAssignmentInner() { - } - - /** - * Get the innerProperties property: The properties of a governance assignment. - * - * @return the innerProperties value. - */ - private GovernanceAssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - public String owner() { - return this.innerProperties() == null ? null : this.innerProperties().owner(); - } - - /** - * Set the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @param owner the owner value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withOwner(String owner) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withOwner(owner); - return this; - } - - /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @return the remediationDueDate value. - */ - public OffsetDateTime remediationDueDate() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDueDate(); - } - - /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @param remediationDueDate the remediationDueDate value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withRemediationDueDate(OffsetDateTime remediationDueDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withRemediationDueDate(remediationDueDate); - return this; - } - - /** - * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - public RemediationEta remediationEta() { - return this.innerProperties() == null ? null : this.innerProperties().remediationEta(); - } - - /** - * Set the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @param remediationEta the remediationEta value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withRemediationEta(RemediationEta remediationEta) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withRemediationEta(remediationEta); - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.innerProperties() == null ? null : this.innerProperties().isGracePeriod(); - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withIsGracePeriod(Boolean isGracePeriod) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withIsGracePeriod(isGracePeriod); - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceEmailNotification governanceEmailNotification() { - return this.innerProperties() == null ? null : this.innerProperties().governanceEmailNotification(); - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner - withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - /** - * Get the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - public GovernanceAssignmentAdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @param additionalData the additionalData value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceAssignmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceAssignmentInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GovernanceAssignmentInner. - */ - public static GovernanceAssignmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceAssignmentInner deserializedGovernanceAssignmentInner = new GovernanceAssignmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGovernanceAssignmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGovernanceAssignmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGovernanceAssignmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGovernanceAssignmentInner.innerProperties - = GovernanceAssignmentProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceAssignmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java deleted file mode 100644 index 152a28ae34691..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Describes properties of an governance assignment. - */ -@Fluent -public final class GovernanceAssignmentProperties implements JsonSerializable { - /* - * The Owner for the governance assignment - e.g. user@contoso.com - see example - */ - private String owner; - - /* - * The remediation due-date - after this date Secure Score will be affected (in case of active grace-period) - */ - private OffsetDateTime remediationDueDate; - - /* - * The ETA (estimated time of arrival) for remediation (optional), see example - */ - private RemediationEta remediationEta; - - /* - * Defines whether there is a grace period on the governance assignment - */ - private Boolean isGracePeriod; - - /* - * The email notifications settings for the governance rule, states whether to disable notifications for mangers and - * owners - */ - private GovernanceEmailNotification governanceEmailNotification; - - /* - * The additional data for the governance assignment - e.g. links to ticket (optional), see example - */ - private GovernanceAssignmentAdditionalData additionalData; - - /** - * Creates an instance of GovernanceAssignmentProperties class. - */ - public GovernanceAssignmentProperties() { - } - - /** - * Get the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - public String owner() { - return this.owner; - } - - /** - * Set the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @param owner the owner value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withOwner(String owner) { - this.owner = owner; - return this; - } - - /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @return the remediationDueDate value. - */ - public OffsetDateTime remediationDueDate() { - return this.remediationDueDate; - } - - /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @param remediationDueDate the remediationDueDate value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withRemediationDueDate(OffsetDateTime remediationDueDate) { - this.remediationDueDate = remediationDueDate; - return this; - } - - /** - * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - public RemediationEta remediationEta() { - return this.remediationEta; - } - - /** - * Set the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @param remediationEta the remediationEta value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withRemediationEta(RemediationEta remediationEta) { - this.remediationEta = remediationEta; - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.isGracePeriod; - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withIsGracePeriod(Boolean isGracePeriod) { - this.isGracePeriod = isGracePeriod; - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceEmailNotification governanceEmailNotification() { - return this.governanceEmailNotification; - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties - withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { - this.governanceEmailNotification = governanceEmailNotification; - return this; - } - - /** - * Get the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - public GovernanceAssignmentAdditionalData additionalData() { - return this.additionalData; - } - - /** - * Set the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @param additionalData the additionalData value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (remediationDueDate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property remediationDueDate in model GovernanceAssignmentProperties")); - } - if (remediationEta() != null) { - remediationEta().validate(); - } - if (governanceEmailNotification() != null) { - governanceEmailNotification().validate(); - } - if (additionalData() != null) { - additionalData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GovernanceAssignmentProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("remediationDueDate", - this.remediationDueDate == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.remediationDueDate)); - jsonWriter.writeStringField("owner", this.owner); - jsonWriter.writeJsonField("remediationEta", this.remediationEta); - jsonWriter.writeBooleanField("isGracePeriod", this.isGracePeriod); - jsonWriter.writeJsonField("governanceEmailNotification", this.governanceEmailNotification); - jsonWriter.writeJsonField("additionalData", this.additionalData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceAssignmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceAssignmentProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GovernanceAssignmentProperties. - */ - public static GovernanceAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceAssignmentProperties deserializedGovernanceAssignmentProperties - = new GovernanceAssignmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("remediationDueDate".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.remediationDueDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("owner".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.owner = reader.getString(); - } else if ("remediationEta".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.remediationEta = RemediationEta.fromJson(reader); - } else if ("isGracePeriod".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.isGracePeriod - = reader.getNullable(JsonReader::getBoolean); - } else if ("governanceEmailNotification".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.governanceEmailNotification - = GovernanceEmailNotification.fromJson(reader); - } else if ("additionalData".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.additionalData - = GovernanceAssignmentAdditionalData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceAssignmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java deleted file mode 100644 index e109f4846fe75..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.List; - -/** - * Governance rule over a given scope. - */ -@Fluent -public final class GovernanceRuleInner extends ProxyResource { - /* - * Properties of a governance rule - */ - private GovernanceRuleProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GovernanceRuleInner class. - */ - public GovernanceRuleInner() { - } - - /** - * Get the innerProperties property: Properties of a governance rule. - * - * @return the innerProperties value. - */ - private GovernanceRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); - } - - /** - * Get the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the governance rule. - * - * @param displayName the displayName value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: Description of the governance rule. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the governance rule. - * - * @param description the description value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - public String remediationTimeframe() { - return this.innerProperties() == null ? null : this.innerProperties().remediationTimeframe(); - } - - /** - * Set the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe the remediationTimeframe value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRemediationTimeframe(String remediationTimeframe) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRemediationTimeframe(remediationTimeframe); - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.innerProperties() == null ? null : this.innerProperties().isGracePeriod(); - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIsGracePeriod(Boolean isGracePeriod) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIsGracePeriod(isGracePeriod); - return this; - } - - /** - * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - public Integer rulePriority() { - return this.innerProperties() == null ? null : this.innerProperties().rulePriority(); - } - - /** - * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @param rulePriority the rulePriority value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRulePriority(Integer rulePriority) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRulePriority(rulePriority); - return this; - } - - /** - * Get the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.innerProperties() == null ? null : this.innerProperties().isDisabled(); - } - - /** - * Set the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled the isDisabled value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIsDisabled(Boolean isDisabled) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIsDisabled(isDisabled); - return this; - } - - /** - * Get the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - public GovernanceRuleType ruleType() { - return this.innerProperties() == null ? null : this.innerProperties().ruleType(); - } - - /** - * Set the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @param ruleType the ruleType value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRuleType(GovernanceRuleType ruleType) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRuleType(ruleType); - return this; - } - - /** - * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().sourceResourceType(); - } - - /** - * Set the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withSourceResourceType(sourceResourceType); - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.innerProperties() == null ? null : this.innerProperties().excludedScopes(); - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withExcludedScopes(List excludedScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withExcludedScopes(excludedScopes); - return this; - } - - /** - * Get the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.innerProperties() == null ? null : this.innerProperties().conditionSets(); - } - - /** - * Set the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withConditionSets(List conditionSets) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withConditionSets(conditionSets); - return this; - } - - /** - * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - public Boolean includeMemberScopes() { - return this.innerProperties() == null ? null : this.innerProperties().includeMemberScopes(); - } - - /** - * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @param includeMemberScopes the includeMemberScopes value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIncludeMemberScopes(Boolean includeMemberScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIncludeMemberScopes(includeMemberScopes); - return this; - } - - /** - * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @return the ownerSource value. - */ - public GovernanceRuleOwnerSource ownerSource() { - return this.innerProperties() == null ? null : this.innerProperties().ownerSource(); - } - - /** - * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @param ownerSource the ownerSource value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withOwnerSource(ownerSource); - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.innerProperties() == null ? null : this.innerProperties().governanceEmailNotification(); - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner - withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - /** - * Get the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - public GovernanceRuleMetadata metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The governance rule metadata. - * - * @param metadata the metadata value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withMetadata(GovernanceRuleMetadata metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceRuleInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceRuleInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GovernanceRuleInner. - */ - public static GovernanceRuleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceRuleInner deserializedGovernanceRuleInner = new GovernanceRuleInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGovernanceRuleInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGovernanceRuleInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGovernanceRuleInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGovernanceRuleInner.innerProperties = GovernanceRuleProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceRuleInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java deleted file mode 100644 index 6921d2b800509..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java +++ /dev/null @@ -1,538 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of an governance rule. - */ -@Fluent -public final class GovernanceRuleProperties implements JsonSerializable { - /* - * The tenantId (GUID) - */ - private String tenantId; - - /* - * Display name of the governance rule - */ - private String displayName; - - /* - * Description of the governance rule - */ - private String description; - - /* - * Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. - * 7.00:00:00 - means 7 days - */ - private String remediationTimeframe; - - /* - * Defines whether there is a grace period on the governance rule - */ - private Boolean isGracePeriod; - - /* - * The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will - * not be allowed - */ - private int rulePriority; - - /* - * Defines whether the rule is active/inactive - */ - private Boolean isDisabled; - - /* - * The rule type of the governance rule, defines the source of the rule e.g. Integrated - */ - private GovernanceRuleType ruleType; - - /* - * The governance rule source, what the rule affects, e.g. Assessments - */ - private GovernanceRuleSourceResourceType sourceResourceType; - - /* - * Excluded scopes, filter out the descendants of the scope (on management scopes) - */ - private List excludedScopes; - - /* - * The governance rule conditionSets - see examples - */ - private List conditionSets; - - /* - * Defines whether the rule is management scope rule (master connector as a single scope or management scope) - */ - private Boolean includeMemberScopes; - - /* - * The owner source for the governance rule - e.g. Manually by user@contoso.com - see example - */ - private GovernanceRuleOwnerSource ownerSource; - - /* - * The email notifications settings for the governance rule, states whether to disable notifications for mangers and - * owners - */ - private GovernanceRuleEmailNotification governanceEmailNotification; - - /* - * The governance rule metadata - */ - private GovernanceRuleMetadata metadata; - - /** - * Creates an instance of GovernanceRuleProperties class. - */ - public GovernanceRuleProperties() { - } - - /** - * Get the tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the governance rule. - * - * @param displayName the displayName value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Description of the governance rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the governance rule. - * - * @param description the description value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - public String remediationTimeframe() { - return this.remediationTimeframe; - } - - /** - * Set the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe the remediationTimeframe value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRemediationTimeframe(String remediationTimeframe) { - this.remediationTimeframe = remediationTimeframe; - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.isGracePeriod; - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIsGracePeriod(Boolean isGracePeriod) { - this.isGracePeriod = isGracePeriod; - return this; - } - - /** - * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - public int rulePriority() { - return this.rulePriority; - } - - /** - * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @param rulePriority the rulePriority value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRulePriority(int rulePriority) { - this.rulePriority = rulePriority; - return this; - } - - /** - * Get the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.isDisabled; - } - - /** - * Set the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled the isDisabled value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIsDisabled(Boolean isDisabled) { - this.isDisabled = isDisabled; - return this; - } - - /** - * Get the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - public GovernanceRuleType ruleType() { - return this.ruleType; - } - - /** - * Set the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @param ruleType the ruleType value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRuleType(GovernanceRuleType ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.sourceResourceType; - } - - /** - * Set the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - this.sourceResourceType = sourceResourceType; - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.excludedScopes; - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withExcludedScopes(List excludedScopes) { - this.excludedScopes = excludedScopes; - return this; - } - - /** - * Get the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.conditionSets; - } - - /** - * Set the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withConditionSets(List conditionSets) { - this.conditionSets = conditionSets; - return this; - } - - /** - * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - public Boolean includeMemberScopes() { - return this.includeMemberScopes; - } - - /** - * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @param includeMemberScopes the includeMemberScopes value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIncludeMemberScopes(Boolean includeMemberScopes) { - this.includeMemberScopes = includeMemberScopes; - return this; - } - - /** - * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @return the ownerSource value. - */ - public GovernanceRuleOwnerSource ownerSource() { - return this.ownerSource; - } - - /** - * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @param ownerSource the ownerSource value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - this.ownerSource = ownerSource; - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.governanceEmailNotification; - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties - withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { - this.governanceEmailNotification = governanceEmailNotification; - return this; - } - - /** - * Get the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - public GovernanceRuleMetadata metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The governance rule metadata. - * - * @param metadata the metadata value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withMetadata(GovernanceRuleMetadata metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model GovernanceRuleProperties")); - } - if (ruleType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property ruleType in model GovernanceRuleProperties")); - } - if (sourceResourceType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sourceResourceType in model GovernanceRuleProperties")); - } - if (conditionSets() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property conditionSets in model GovernanceRuleProperties")); - } - if (ownerSource() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property ownerSource in model GovernanceRuleProperties")); - } else { - ownerSource().validate(); - } - if (governanceEmailNotification() != null) { - governanceEmailNotification().validate(); - } - if (metadata() != null) { - metadata().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRuleProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeIntField("rulePriority", this.rulePriority); - jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); - jsonWriter.writeStringField("sourceResourceType", - this.sourceResourceType == null ? null : this.sourceResourceType.toString()); - jsonWriter.writeArrayField("conditionSets", this.conditionSets, - (writer, element) -> writer.writeUntyped(element)); - jsonWriter.writeJsonField("ownerSource", this.ownerSource); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("remediationTimeframe", this.remediationTimeframe); - jsonWriter.writeBooleanField("isGracePeriod", this.isGracePeriod); - jsonWriter.writeBooleanField("isDisabled", this.isDisabled); - jsonWriter.writeArrayField("excludedScopes", this.excludedScopes, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("includeMemberScopes", this.includeMemberScopes); - jsonWriter.writeJsonField("governanceEmailNotification", this.governanceEmailNotification); - jsonWriter.writeJsonField("metadata", this.metadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceRuleProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceRuleProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GovernanceRuleProperties. - */ - public static GovernanceRuleProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceRuleProperties deserializedGovernanceRuleProperties = new GovernanceRuleProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedGovernanceRuleProperties.displayName = reader.getString(); - } else if ("rulePriority".equals(fieldName)) { - deserializedGovernanceRuleProperties.rulePriority = reader.getInt(); - } else if ("ruleType".equals(fieldName)) { - deserializedGovernanceRuleProperties.ruleType = GovernanceRuleType.fromString(reader.getString()); - } else if ("sourceResourceType".equals(fieldName)) { - deserializedGovernanceRuleProperties.sourceResourceType - = GovernanceRuleSourceResourceType.fromString(reader.getString()); - } else if ("conditionSets".equals(fieldName)) { - List conditionSets = reader.readArray(reader1 -> reader1.readUntyped()); - deserializedGovernanceRuleProperties.conditionSets = conditionSets; - } else if ("ownerSource".equals(fieldName)) { - deserializedGovernanceRuleProperties.ownerSource = GovernanceRuleOwnerSource.fromJson(reader); - } else if ("tenantId".equals(fieldName)) { - deserializedGovernanceRuleProperties.tenantId = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedGovernanceRuleProperties.description = reader.getString(); - } else if ("remediationTimeframe".equals(fieldName)) { - deserializedGovernanceRuleProperties.remediationTimeframe = reader.getString(); - } else if ("isGracePeriod".equals(fieldName)) { - deserializedGovernanceRuleProperties.isGracePeriod = reader.getNullable(JsonReader::getBoolean); - } else if ("isDisabled".equals(fieldName)) { - deserializedGovernanceRuleProperties.isDisabled = reader.getNullable(JsonReader::getBoolean); - } else if ("excludedScopes".equals(fieldName)) { - List excludedScopes = reader.readArray(reader1 -> reader1.getString()); - deserializedGovernanceRuleProperties.excludedScopes = excludedScopes; - } else if ("includeMemberScopes".equals(fieldName)) { - deserializedGovernanceRuleProperties.includeMemberScopes - = reader.getNullable(JsonReader::getBoolean); - } else if ("governanceEmailNotification".equals(fieldName)) { - deserializedGovernanceRuleProperties.governanceEmailNotification - = GovernanceRuleEmailNotification.fromJson(reader); - } else if ("metadata".equals(fieldName)) { - deserializedGovernanceRuleProperties.metadata = GovernanceRuleMetadata.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceRuleProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java deleted file mode 100644 index 0b1dc8f30ce3a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.Issue; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.StatusAutoGenerated; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The health report resource. - */ -@Fluent -public final class HealthReportInner extends ProxyResource { - /* - * Properties of a health report - */ - private HealthReportProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of HealthReportInner class. - */ - public HealthReportInner() { - } - - /** - * Get the innerProperties property: Properties of a health report. - * - * @return the innerProperties value. - */ - private HealthReportProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the resourceDetails property: The resource details of the health report. - * - * @return the resourceDetails value. - */ - public ResourceDetailsAutoGenerated resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Set the resourceDetails property: The resource details of the health report. - * - * @param resourceDetails the resourceDetails value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withResourceDetails(resourceDetails); - return this; - } - - /** - * Get the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - public EnvironmentDetails environmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().environmentDetails(); - } - - /** - * Set the environmentDetails property: The environment details of the resource. - * - * @param environmentDetails the environmentDetails value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withEnvironmentDetails(EnvironmentDetails environmentDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withEnvironmentDetails(environmentDetails); - return this; - } - - /** - * Get the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - public HealthDataClassification healthDataClassification() { - return this.innerProperties() == null ? null : this.innerProperties().healthDataClassification(); - } - - /** - * Set the healthDataClassification property: The classification of the health report. - * - * @param healthDataClassification the healthDataClassification value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withHealthDataClassification(HealthDataClassification healthDataClassification) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withHealthDataClassification(healthDataClassification); - return this; - } - - /** - * Get the status property: The status of the health report. - * - * @return the status value. - */ - public StatusAutoGenerated status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the health report. - * - * @param status the status value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withStatus(StatusAutoGenerated status) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - public List affectedDefendersPlans() { - return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersPlans(); - } - - /** - * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @param affectedDefendersPlans the affectedDefendersPlans value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withAffectedDefendersPlans(List affectedDefendersPlans) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withAffectedDefendersPlans(affectedDefendersPlans); - return this; - } - - /** - * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. - * - * @return the affectedDefendersSubPlans value. - */ - public List affectedDefendersSubPlans() { - return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersSubPlans(); - } - - /** - * Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. - * - * @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withAffectedDefendersSubPlans(List affectedDefendersSubPlans) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withAffectedDefendersSubPlans(affectedDefendersSubPlans); - return this; - } - - /** - * Get the reportAdditionalData property: Additional data for the given health report, this field can include more - * details on the resource and the health scenario. - * - * @return the reportAdditionalData value. - */ - public Map reportAdditionalData() { - return this.innerProperties() == null ? null : this.innerProperties().reportAdditionalData(); - } - - /** - * Get the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - public List issues() { - return this.innerProperties() == null ? null : this.innerProperties().issues(); - } - - /** - * Set the issues property: A collection of the issues in the report. - * - * @param issues the issues value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withIssues(List issues) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withIssues(issues); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HealthReportInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HealthReportInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the HealthReportInner. - */ - public static HealthReportInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HealthReportInner deserializedHealthReportInner = new HealthReportInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedHealthReportInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedHealthReportInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedHealthReportInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedHealthReportInner.innerProperties = HealthReportProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHealthReportInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java deleted file mode 100644 index 3c3cf5c1fbd5b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.Issue; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.StatusAutoGenerated; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Describes properties of the health report. - */ -@Fluent -public final class HealthReportProperties implements JsonSerializable { - /* - * The resource details of the health report - */ - private ResourceDetailsAutoGenerated resourceDetails; - - /* - * The environment details of the resource - */ - private EnvironmentDetails environmentDetails; - - /* - * The classification of the health report - */ - private HealthDataClassification healthDataClassification; - - /* - * The status of the health report - */ - private StatusAutoGenerated status; - - /* - * The affected defenders plans by unhealthy report - */ - private List affectedDefendersPlans; - - /* - * The affected defenders sub plans by unhealthy report - */ - private List affectedDefendersSubPlans; - - /* - * Additional data for the given health report, this field can include more details on the resource and the health - * scenario. - */ - private Map reportAdditionalData; - - /* - * A collection of the issues in the report - */ - private List issues; - - /** - * Creates an instance of HealthReportProperties class. - */ - public HealthReportProperties() { - } - - /** - * Get the resourceDetails property: The resource details of the health report. - * - * @return the resourceDetails value. - */ - public ResourceDetailsAutoGenerated resourceDetails() { - return this.resourceDetails; - } - - /** - * Set the resourceDetails property: The resource details of the health report. - * - * @param resourceDetails the resourceDetails value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) { - this.resourceDetails = resourceDetails; - return this; - } - - /** - * Get the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - public EnvironmentDetails environmentDetails() { - return this.environmentDetails; - } - - /** - * Set the environmentDetails property: The environment details of the resource. - * - * @param environmentDetails the environmentDetails value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withEnvironmentDetails(EnvironmentDetails environmentDetails) { - this.environmentDetails = environmentDetails; - return this; - } - - /** - * Get the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - public HealthDataClassification healthDataClassification() { - return this.healthDataClassification; - } - - /** - * Set the healthDataClassification property: The classification of the health report. - * - * @param healthDataClassification the healthDataClassification value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withHealthDataClassification(HealthDataClassification healthDataClassification) { - this.healthDataClassification = healthDataClassification; - return this; - } - - /** - * Get the status property: The status of the health report. - * - * @return the status value. - */ - public StatusAutoGenerated status() { - return this.status; - } - - /** - * Set the status property: The status of the health report. - * - * @param status the status value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withStatus(StatusAutoGenerated status) { - this.status = status; - return this; - } - - /** - * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - public List affectedDefendersPlans() { - return this.affectedDefendersPlans; - } - - /** - * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @param affectedDefendersPlans the affectedDefendersPlans value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withAffectedDefendersPlans(List affectedDefendersPlans) { - this.affectedDefendersPlans = affectedDefendersPlans; - return this; - } - - /** - * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. - * - * @return the affectedDefendersSubPlans value. - */ - public List affectedDefendersSubPlans() { - return this.affectedDefendersSubPlans; - } - - /** - * Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. - * - * @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withAffectedDefendersSubPlans(List affectedDefendersSubPlans) { - this.affectedDefendersSubPlans = affectedDefendersSubPlans; - return this; - } - - /** - * Get the reportAdditionalData property: Additional data for the given health report, this field can include more - * details on the resource and the health scenario. - * - * @return the reportAdditionalData value. - */ - public Map reportAdditionalData() { - return this.reportAdditionalData; - } - - /** - * Get the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - public List issues() { - return this.issues; - } - - /** - * Set the issues property: A collection of the issues in the report. - * - * @param issues the issues value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withIssues(List issues) { - this.issues = issues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceDetails() != null) { - resourceDetails().validate(); - } - if (environmentDetails() != null) { - environmentDetails().validate(); - } - if (healthDataClassification() != null) { - healthDataClassification().validate(); - } - if (status() != null) { - status().validate(); - } - if (issues() != null) { - issues().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("resourceDetails", this.resourceDetails); - jsonWriter.writeJsonField("environmentDetails", this.environmentDetails); - jsonWriter.writeJsonField("healthDataClassification", this.healthDataClassification); - jsonWriter.writeJsonField("status", this.status); - jsonWriter.writeArrayField("affectedDefendersPlans", this.affectedDefendersPlans, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("affectedDefendersSubPlans", this.affectedDefendersSubPlans, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("issues", this.issues, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HealthReportProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HealthReportProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the HealthReportProperties. - */ - public static HealthReportProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HealthReportProperties deserializedHealthReportProperties = new HealthReportProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceDetails".equals(fieldName)) { - deserializedHealthReportProperties.resourceDetails = ResourceDetailsAutoGenerated.fromJson(reader); - } else if ("environmentDetails".equals(fieldName)) { - deserializedHealthReportProperties.environmentDetails = EnvironmentDetails.fromJson(reader); - } else if ("healthDataClassification".equals(fieldName)) { - deserializedHealthReportProperties.healthDataClassification - = HealthDataClassification.fromJson(reader); - } else if ("status".equals(fieldName)) { - deserializedHealthReportProperties.status = StatusAutoGenerated.fromJson(reader); - } else if ("affectedDefendersPlans".equals(fieldName)) { - List affectedDefendersPlans = reader.readArray(reader1 -> reader1.getString()); - deserializedHealthReportProperties.affectedDefendersPlans = affectedDefendersPlans; - } else if ("affectedDefendersSubPlans".equals(fieldName)) { - List affectedDefendersSubPlans = reader.readArray(reader1 -> reader1.getString()); - deserializedHealthReportProperties.affectedDefendersSubPlans = affectedDefendersSubPlans; - } else if ("reportAdditionalData".equals(fieldName)) { - Map reportAdditionalData = reader.readMap(reader1 -> reader1.getString()); - deserializedHealthReportProperties.reportAdditionalData = reportAdditionalData; - } else if ("issues".equals(fieldName)) { - List issues = reader.readArray(reader1 -> Issue.fromJson(reader1)); - deserializedHealthReportProperties.issues = issues; - } else { - reader.skipChildren(); - } - } - - return deserializedHealthReportProperties; - }); - } -} 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 deleted file mode 100644 index 1a8fc7aaed20c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * Information protection policy. - */ -@Fluent -public final class InformationProtectionPolicyInner extends ProxyResource { - /* - * Information protection policy data - */ - private InformationProtectionPolicyProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of InformationProtectionPolicyInner class. - */ - public InformationProtectionPolicyInner() { - } - - /** - * Get the innerProperties property: Information protection policy data. - * - * @return the innerProperties value. - */ - private InformationProtectionPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); - } - - /** - * Get the version property: Describes the version of the policy. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the labels property: Dictionary of sensitivity labels. - * - * @return the labels value. - */ - public Map labels() { - return this.innerProperties() == null ? null : this.innerProperties().labels(); - } - - /** - * Set the labels property: Dictionary of sensitivity labels. - * - * @param labels the labels value to set. - * @return the InformationProtectionPolicyInner object itself. - */ - public InformationProtectionPolicyInner withLabels(Map labels) { - if (this.innerProperties() == null) { - this.innerProperties = new InformationProtectionPolicyProperties(); - } - this.innerProperties().withLabels(labels); - return this; - } - - /** - * Get the informationTypes property: The sensitivity information types. - * - * @return the informationTypes value. - */ - public Map informationTypes() { - return this.innerProperties() == null ? null : this.innerProperties().informationTypes(); - } - - /** - * Set the informationTypes property: The sensitivity information types. - * - * @param informationTypes the informationTypes value to set. - * @return the InformationProtectionPolicyInner object itself. - */ - public InformationProtectionPolicyInner withInformationTypes(Map informationTypes) { - if (this.innerProperties() == null) { - this.innerProperties = new InformationProtectionPolicyProperties(); - } - this.innerProperties().withInformationTypes(informationTypes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InformationProtectionPolicyInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InformationProtectionPolicyInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InformationProtectionPolicyInner. - */ - public static InformationProtectionPolicyInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InformationProtectionPolicyInner deserializedInformationProtectionPolicyInner - = new InformationProtectionPolicyInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.innerProperties - = InformationProtectionPolicyProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedInformationProtectionPolicyInner; - }); - } -} 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 deleted file mode 100644 index a7cfe8602c721..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * describes properties of an information protection policy. - */ -@Fluent -public final class InformationProtectionPolicyProperties - implements JsonSerializable { - /* - * Describes the last UTC time the policy was modified. - */ - private OffsetDateTime lastModifiedUtc; - - /* - * Describes the version of the policy. - */ - private String version; - - /* - * Dictionary of sensitivity labels. - */ - private Map labels; - - /* - * The sensitivity information types. - */ - private Map informationTypes; - - /** - * Creates an instance of InformationProtectionPolicyProperties class. - */ - public InformationProtectionPolicyProperties() { - } - - /** - * 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(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("informationTypes", this.informationTypes, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InformationProtectionPolicyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InformationProtectionPolicyProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the InformationProtectionPolicyProperties. - */ - public static InformationProtectionPolicyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InformationProtectionPolicyProperties deserializedInformationProtectionPolicyProperties - = new InformationProtectionPolicyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lastModifiedUtc".equals(fieldName)) { - deserializedInformationProtectionPolicyProperties.lastModifiedUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("version".equals(fieldName)) { - deserializedInformationProtectionPolicyProperties.version = reader.getString(); - } else if ("labels".equals(fieldName)) { - Map labels - = reader.readMap(reader1 -> SensitivityLabel.fromJson(reader1)); - deserializedInformationProtectionPolicyProperties.labels = labels; - } else if ("informationTypes".equals(fieldName)) { - Map informationTypes - = reader.readMap(reader1 -> InformationType.fromJson(reader1)); - deserializedInformationProtectionPolicyProperties.informationTypes = informationTypes; - } else { - reader.skipChildren(); - } - } - - return deserializedInformationProtectionPolicyProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.java deleted file mode 100644 index 90b0339e3e3c5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.MalwareScanProperties; -import java.io.IOException; - -/** - * Describes the state of a malware scan operation. - */ -@Fluent -public final class MalwareScanInner implements JsonSerializable { - /* - * The properties property. - */ - private MalwareScanProperties properties; - - /** - * Creates an instance of MalwareScanInner class. - */ - public MalwareScanInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public MalwareScanProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties property. - * - * @param properties the properties value to set. - * @return the MalwareScanInner object itself. - */ - public MalwareScanInner withProperties(MalwareScanProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MalwareScanInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MalwareScanInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MalwareScanInner. - */ - public static MalwareScanInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MalwareScanInner deserializedMalwareScanInner = new MalwareScanInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedMalwareScanInner.properties = MalwareScanProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMalwareScanInner; - }); - } -} 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 deleted file mode 100644 index 08ee0644c6a9c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The resource of the configuration or data needed to onboard the machine to MDE. - */ -@Fluent -public final class MdeOnboardingDataInner extends ProxyResource { - private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - - /* - * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE - */ - private MdeOnboardingDataProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of MdeOnboardingDataInner class. - */ - public MdeOnboardingDataInner() { - } - - /** - * 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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 ? EMPTY_BYTE_ARRAY : 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 ? EMPTY_BYTE_ARRAY : 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MdeOnboardingDataInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MdeOnboardingDataInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the MdeOnboardingDataInner. - */ - public static MdeOnboardingDataInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MdeOnboardingDataInner deserializedMdeOnboardingDataInner = new MdeOnboardingDataInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedMdeOnboardingDataInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedMdeOnboardingDataInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedMdeOnboardingDataInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedMdeOnboardingDataInner.innerProperties = MdeOnboardingDataProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMdeOnboardingDataInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java deleted file mode 100644 index b52fa027c861f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * List of all MDE onboarding data resources. - */ -@Fluent -public final class MdeOnboardingDataListInner implements JsonSerializable { - /* - * List of the resources of the configuration or data needed to onboard the machine to MDE - */ - private List value; - - /** - * Creates an instance of MdeOnboardingDataListInner class. - */ - public MdeOnboardingDataListInner() { - } - - /** - * 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() { - return this.value; - } - - /** - * 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 MdeOnboardingDataListInner object itself. - */ - public MdeOnboardingDataListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MdeOnboardingDataListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MdeOnboardingDataListInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the MdeOnboardingDataListInner. - */ - public static MdeOnboardingDataListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MdeOnboardingDataListInner deserializedMdeOnboardingDataListInner = new MdeOnboardingDataListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> MdeOnboardingDataInner.fromJson(reader1)); - deserializedMdeOnboardingDataListInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedMdeOnboardingDataListInner; - }); - } -} 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 deleted file mode 100644 index be730349ba3ed..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE. - */ -@Fluent -public final class MdeOnboardingDataProperties implements JsonSerializable { - /* - * 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 - */ - 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 - */ - private byte[] onboardingPackageLinux; - - /** - * Creates an instance of MdeOnboardingDataProperties class. - */ - public MdeOnboardingDataProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBinaryField("onboardingPackageWindows", this.onboardingPackageWindows); - jsonWriter.writeBinaryField("onboardingPackageLinux", this.onboardingPackageLinux); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MdeOnboardingDataProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MdeOnboardingDataProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the MdeOnboardingDataProperties. - */ - public static MdeOnboardingDataProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MdeOnboardingDataProperties deserializedMdeOnboardingDataProperties = new MdeOnboardingDataProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("onboardingPackageWindows".equals(fieldName)) { - deserializedMdeOnboardingDataProperties.onboardingPackageWindows = reader.getBinary(); - } else if ("onboardingPackageLinux".equals(fieldName)) { - deserializedMdeOnboardingDataProperties.onboardingPackageLinux = reader.getBinary(); - } else { - reader.skipChildren(); - } - } - - return deserializedMdeOnboardingDataProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java deleted file mode 100644 index 1e17d36a44e42..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ActionType; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.azure.resourcemanager.security.models.Origin; -import java.io.IOException; - -/** - * REST API Operation - * - * Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Fluent -public final class OperationInner implements JsonSerializable { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. - */ - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - private ActionType actionType; - - /** - * Creates an instance of OperationInner class. - */ - public OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationInner. - */ - public static OperationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInner deserializedOperationInner = new OperationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationInner.name = reader.getString(); - } else if ("isDataAction".equals(fieldName)) { - deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); - } else if ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationDisplay.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = Origin.fromString(reader.getString()); - } else if ("actionType".equals(fieldName)) { - deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java deleted file mode 100644 index f6e0d792b6def..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.OperationResult; -import java.io.IOException; - -/** - * Long run operation status of governance rule over a given scope. - */ -@Immutable -public final class OperationResultAutoGeneratedInner implements JsonSerializable { - /* - * The status of the long run operation result of governance rule - */ - private OperationResult status; - - /** - * Creates an instance of OperationResultAutoGeneratedInner class. - */ - public OperationResultAutoGeneratedInner() { - } - - /** - * Get the status property: The status of the long run operation result of governance rule. - * - * @return the status value. - */ - public OperationResult status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationResultAutoGeneratedInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationResultAutoGeneratedInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationResultAutoGeneratedInner. - */ - public static OperationResultAutoGeneratedInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationResultAutoGeneratedInner deserializedOperationResultAutoGeneratedInner - = new OperationResultAutoGeneratedInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationResultAutoGeneratedInner.status - = OperationResult.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationResultAutoGeneratedInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java deleted file mode 100644 index c1afb3a124be7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * The current status of an async operation. - */ -@Fluent -public final class OperationStatusResultInner implements JsonSerializable { - /* - * Fully qualified ID for the async operation. - */ - private String id; - - /* - * Name of the async operation. - */ - private String name; - - /* - * Operation status. - */ - private String status; - - /* - * Percent of the operation that is complete. - */ - private Float percentComplete; - - /* - * The start time of the operation. - */ - private OffsetDateTime startTime; - - /* - * The end time of the operation. - */ - private OffsetDateTime endTime; - - /* - * The operations list. - */ - private List operations; - - /* - * If present, details of the operation error. - */ - private ManagementError error; - - /** - * Creates an instance of OperationStatusResultInner class. - */ - public OperationStatusResultInner() { - } - - /** - * Get the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Fully qualified ID for the async operation. - * - * @param id the id value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Name of the async operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the async operation. - * - * @param name the name value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the status property: Operation status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Operation status. - * - * @param status the status value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - public Float percentComplete() { - return this.percentComplete; - } - - /** - * Set the percentComplete property: Percent of the operation that is complete. - * - * @param percentComplete the percentComplete value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withPercentComplete(Float percentComplete) { - this.percentComplete = percentComplete; - return this; - } - - /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time of the operation. - * - * @param startTime the startTime value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time of the operation. - * - * @param endTime the endTime value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the operations property: The operations list. - * - * @return the operations value. - */ - public List operations() { - return this.operations; - } - - /** - * Set the operations property: The operations list. - * - * @param operations the operations value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withOperations(List operations) { - this.operations = operations; - return this; - } - - /** - * Get the error property: If present, details of the operation error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: If present, details of the operation error. - * - * @param error the error value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model OperationStatusResultInner")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeNumberField("percentComplete", this.percentComplete); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationStatusResultInner. - */ - public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationStatusResultInner.status = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedOperationStatusResultInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusResultInner.name = reader.getString(); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getFloat); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusResultInner.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusResultInner.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); - deserializedOperationStatusResultInner.operations = operations; - } else if ("error".equals(fieldName)) { - deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusResultInner; - }); - } -} 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 deleted file mode 100644 index db1ceabcf8cb3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance assessment details and state. - */ -@Fluent -public final class RegulatoryComplianceAssessmentInner extends ProxyResource { - /* - * Regulatory compliance assessment data - */ - private RegulatoryComplianceAssessmentProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of RegulatoryComplianceAssessmentInner class. - */ - public RegulatoryComplianceAssessmentInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance assessment data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceAssessmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the description property: The description of the regulatory compliance assessment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * - * @return the assessmentType value. - */ - public String assessmentType() { - return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().assessmentDetailsLink(); - } - - /** - * Get the state property: Aggregative state based on the assessment's scanned resources states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Aggregative state based on the assessment's scanned resources states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceAssessmentInner object itself. - */ - public RegulatoryComplianceAssessmentInner withState(State state) { - if (this.innerProperties() == null) { - this.innerProperties = new RegulatoryComplianceAssessmentProperties(); - } - this.innerProperties().withState(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.innerProperties() == null ? null : this.innerProperties().passedResources(); - } - - /** - * Get the failedResources property: The given assessment's related resources count with failed state. - * - * @return the failedResources value. - */ - public Integer failedResources() { - return this.innerProperties() == null ? null : this.innerProperties().failedResources(); - } - - /** - * Get the skippedResources property: The given assessment's related resources count with skipped state. - * - * @return the skippedResources value. - */ - public Integer skippedResources() { - return this.innerProperties() == null ? null : this.innerProperties().skippedResources(); - } - - /** - * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * - * @return the unsupportedResources value. - */ - public Integer unsupportedResources() { - return this.innerProperties() == null ? null : this.innerProperties().unsupportedResources(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceAssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceAssessmentInner if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RegulatoryComplianceAssessmentInner. - */ - public static RegulatoryComplianceAssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceAssessmentInner deserializedRegulatoryComplianceAssessmentInner - = new RegulatoryComplianceAssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.innerProperties - = RegulatoryComplianceAssessmentProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceAssessmentInner; - }); - } -} 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 deleted file mode 100644 index fe1aae6b2b076..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance assessment data. - */ -@Fluent -public final class RegulatoryComplianceAssessmentProperties - implements JsonSerializable { - /* - * The description of the regulatory compliance assessment - */ - private String description; - - /* - * The expected type of assessment contained in the AssessmentDetailsLink - */ - private String assessmentType; - - /* - * Link to more detailed assessment results data. The response type will be according to the assessmentType field - */ - private String assessmentDetailsLink; - - /* - * Aggregative state based on the assessment's scanned resources states - */ - private State state; - - /* - * The given assessment's related resources count with passed state. - */ - private Integer passedResources; - - /* - * The given assessment's related resources count with failed state. - */ - private Integer failedResources; - - /* - * The given assessment's related resources count with skipped state. - */ - private Integer skippedResources; - - /* - * The given assessment's related resources count with unsupported state. - */ - private Integer unsupportedResources; - - /** - * Creates an instance of RegulatoryComplianceAssessmentProperties class. - */ - public RegulatoryComplianceAssessmentProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceAssessmentProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the RegulatoryComplianceAssessmentProperties. - */ - public static RegulatoryComplianceAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceAssessmentProperties deserializedRegulatoryComplianceAssessmentProperties - = new RegulatoryComplianceAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.description = reader.getString(); - } else if ("assessmentType".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.assessmentType = reader.getString(); - } else if ("assessmentDetailsLink".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.assessmentDetailsLink = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.state = State.fromString(reader.getString()); - } else if ("passedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.passedResources - = reader.getNullable(JsonReader::getInt); - } else if ("failedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.failedResources - = reader.getNullable(JsonReader::getInt); - } else if ("skippedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.skippedResources - = reader.getNullable(JsonReader::getInt); - } else if ("unsupportedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.unsupportedResources - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceAssessmentProperties; - }); - } -} 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 deleted file mode 100644 index 7d016a07c7e9b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance control details and state. - */ -@Fluent -public final class RegulatoryComplianceControlInner extends ProxyResource { - /* - * Regulatory compliance control data - */ - private RegulatoryComplianceControlProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of RegulatoryComplianceControlInner class. - */ - public RegulatoryComplianceControlInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance control data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceControlProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the description property: The description of the regulatory compliance control. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the state property: Aggregative state based on the control's supported assessments states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Aggregative state based on the control's supported assessments states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceControlInner object itself. - */ - public RegulatoryComplianceControlInner withState(State state) { - if (this.innerProperties() == null) { - this.innerProperties = new RegulatoryComplianceControlProperties(); - } - this.innerProperties().withState(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().skippedAssessments(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceControlInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceControlInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RegulatoryComplianceControlInner. - */ - public static RegulatoryComplianceControlInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceControlInner deserializedRegulatoryComplianceControlInner - = new RegulatoryComplianceControlInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.innerProperties - = RegulatoryComplianceControlProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceControlInner; - }); - } -} 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 deleted file mode 100644 index 57f20f4c41b73..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance control data. - */ -@Fluent -public final class RegulatoryComplianceControlProperties - implements JsonSerializable { - /* - * The description of the regulatory compliance control - */ - private String description; - - /* - * Aggregative state based on the control's supported assessments states - */ - private State state; - - /* - * The number of supported regulatory compliance assessments of the given control with a passed state - */ - private Integer passedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given control with a failed state - */ - private Integer failedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given control with a skipped state - */ - private Integer skippedAssessments; - - /** - * Creates an instance of RegulatoryComplianceControlProperties class. - */ - public RegulatoryComplianceControlProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceControlProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceControlProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the RegulatoryComplianceControlProperties. - */ - public static RegulatoryComplianceControlProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceControlProperties deserializedRegulatoryComplianceControlProperties - = new RegulatoryComplianceControlProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.description = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.state = State.fromString(reader.getString()); - } else if ("passedAssessments".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.passedAssessments - = reader.getNullable(JsonReader::getInt); - } else if ("failedAssessments".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.failedAssessments - = reader.getNullable(JsonReader::getInt); - } else if ("skippedAssessments".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.skippedAssessments - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceControlProperties; - }); - } -} 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 deleted file mode 100644 index 7614a7dc7c31e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance standard details and state. - */ -@Fluent -public final class RegulatoryComplianceStandardInner extends ProxyResource { - /* - * Regulatory compliance standard data - */ - private RegulatoryComplianceStandardProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of RegulatoryComplianceStandardInner class. - */ - public RegulatoryComplianceStandardInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance standard data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceStandardProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the state property: Aggregative state based on the standard's supported controls states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Aggregative state based on the standard's supported controls states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceStandardInner object itself. - */ - public RegulatoryComplianceStandardInner withState(State state) { - if (this.innerProperties() == null) { - this.innerProperties = new RegulatoryComplianceStandardProperties(); - } - this.innerProperties().withState(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().unsupportedControls(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceStandardInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceStandardInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RegulatoryComplianceStandardInner. - */ - public static RegulatoryComplianceStandardInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceStandardInner deserializedRegulatoryComplianceStandardInner - = new RegulatoryComplianceStandardInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.innerProperties - = RegulatoryComplianceStandardProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceStandardInner; - }); - } -} 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 deleted file mode 100644 index ec8c16ee114d0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance standard data. - */ -@Fluent -public final class RegulatoryComplianceStandardProperties - implements JsonSerializable { - /* - * Aggregative state based on the standard's supported controls states - */ - private State state; - - /* - * The number of supported regulatory compliance controls of the given standard with a passed state - */ - private Integer passedControls; - - /* - * The number of supported regulatory compliance controls of the given standard with a failed state - */ - private Integer failedControls; - - /* - * The number of supported regulatory compliance controls of the given standard with a skipped state - */ - private Integer skippedControls; - - /* - * The number of regulatory compliance controls of the given standard which are unsupported by automated assessments - */ - private Integer unsupportedControls; - - /** - * Creates an instance of RegulatoryComplianceStandardProperties class. - */ - public RegulatoryComplianceStandardProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceStandardProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceStandardProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the RegulatoryComplianceStandardProperties. - */ - public static RegulatoryComplianceStandardProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceStandardProperties deserializedRegulatoryComplianceStandardProperties - = new RegulatoryComplianceStandardProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.state = State.fromString(reader.getString()); - } else if ("passedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.passedControls - = reader.getNullable(JsonReader::getInt); - } else if ("failedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.failedControls - = reader.getNullable(JsonReader::getInt); - } else if ("skippedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.skippedControls - = reader.getNullable(JsonReader::getInt); - } else if ("unsupportedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.unsupportedControls - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceStandardProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java deleted file mode 100644 index 78fa700f2ab21..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.io.IOException; - -/** - * Rule results. - */ -@Fluent -public final class RuleResultsInner extends ProxyResource { - /* - * Rule results properties. - */ - private RuleResultsProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of RuleResultsInner class. - */ - public RuleResultsInner() { - } - - /** - * Get the properties property: Rule results properties. - * - * @return the properties value. - */ - public RuleResultsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Rule results properties. - * - * @param properties the properties value to set. - * @return the RuleResultsInner object itself. - */ - public RuleResultsInner withProperties(RuleResultsProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RuleResultsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RuleResultsInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RuleResultsInner. - */ - public static RuleResultsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RuleResultsInner deserializedRuleResultsInner = new RuleResultsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRuleResultsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRuleResultsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRuleResultsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRuleResultsInner.properties = RuleResultsProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRuleResultsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java deleted file mode 100644 index 648fbdef0bf07..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A list of rules results. - */ -@Fluent -public final class RulesResultsInner implements JsonSerializable { - /* - * List of rule results. - */ - private List value; - - /** - * Creates an instance of RulesResultsInner class. - */ - public RulesResultsInner() { - } - - /** - * Get the value property: List of rule results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of rule results. - * - * @param value the value value to set. - * @return the RulesResultsInner object itself. - */ - public RulesResultsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RulesResultsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RulesResultsInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the RulesResultsInner. - */ - public static RulesResultsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RulesResultsInner deserializedRulesResultsInner = new RulesResultsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> RuleResultsInner.fromJson(reader1)); - deserializedRulesResultsInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRulesResultsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java deleted file mode 100644 index 230b3172f5a9a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ScanProperties; -import java.io.IOException; - -/** - * A vulnerability assessment scan record. - */ -@Fluent -public final class ScanInner extends ProxyResource { - /* - * A vulnerability assessment scan record properties. - */ - private ScanProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ScanInner class. - */ - public ScanInner() { - } - - /** - * Get the properties property: A vulnerability assessment scan record properties. - * - * @return the properties value. - */ - public ScanProperties properties() { - return this.properties; - } - - /** - * Set the properties property: A vulnerability assessment scan record properties. - * - * @param properties the properties value to set. - * @return the ScanInner object itself. - */ - public ScanInner withProperties(ScanProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScanInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScanInner if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ScanInner. - */ - public static ScanInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScanInner deserializedScanInner = new ScanInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedScanInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedScanInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedScanInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedScanInner.properties = ScanProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedScanInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java deleted file mode 100644 index 321a1461e1826..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import java.io.IOException; - -/** - * A vulnerability assessment scan result for a single rule. - */ -@Fluent -public final class ScanResultInner extends ProxyResource { - /* - * A vulnerability assessment scan result properties for a single rule. - */ - private ScanResultProperties properties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ScanResultInner class. - */ - public ScanResultInner() { - } - - /** - * Get the properties property: A vulnerability assessment scan result properties for a single rule. - * - * @return the properties value. - */ - public ScanResultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: A vulnerability assessment scan result properties for a single rule. - * - * @param properties the properties value to set. - * @return the ScanResultInner object itself. - */ - public ScanResultInner withProperties(ScanResultProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScanResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScanResultInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ScanResultInner. - */ - public static ScanResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScanResultInner deserializedScanResultInner = new ScanResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedScanResultInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedScanResultInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedScanResultInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedScanResultInner.properties = ScanResultProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedScanResultInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java deleted file mode 100644 index 708e4f7ce8b89..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A list of vulnerability assessment scan results. - */ -@Fluent -public final class ScanResultsInner implements JsonSerializable { - /* - * List of vulnerability assessment scan results. - */ - private List value; - - /** - * Creates an instance of ScanResultsInner class. - */ - public ScanResultsInner() { - } - - /** - * Get the value property: List of vulnerability assessment scan results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of vulnerability assessment scan results. - * - * @param value the value value to set. - * @return the ScanResultsInner object itself. - */ - public ScanResultsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScanResultsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScanResultsInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ScanResultsInner. - */ - public static ScanResultsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScanResultsInner deserializedScanResultsInner = new ScanResultsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ScanResultInner.fromJson(reader1)); - deserializedScanResultsInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedScanResultsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java deleted file mode 100644 index 4d49a998e3a93..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A list of vulnerability assessment scan records. - */ -@Fluent -public final class ScansInner implements JsonSerializable { - /* - * List of vulnerability assessment scan records. - */ - private List value; - - /** - * Creates an instance of ScansInner class. - */ - public ScansInner() { - } - - /** - * Get the value property: List of vulnerability assessment scan records. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of vulnerability assessment scan records. - * - * @param value the value value to set. - * @return the ScansInner object itself. - */ - public ScansInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScansInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScansInner if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IOException If an error occurs while reading the ScansInner. - */ - public static ScansInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScansInner deserializedScansInner = new ScansInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ScanInner.fromJson(reader1)); - deserializedScansInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedScansInner; - }); - } -} 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 deleted file mode 100644 index 1478b56eeb65f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * The security connector resource. - */ -@Fluent -public final class SecurityConnectorInner extends Resource { - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Security connector data - */ - private SecurityConnectorProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SecurityConnectorInner class. - */ - public SecurityConnectorInner() { - } - - /** - * 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; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public 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, - * project number in case of GCP 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, - * project number in case of GCP 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 hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifierTrialEndDate(); - } - - /** - * Get the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - public CloudName environmentName() { - return this.innerProperties() == null ? null : this.innerProperties().environmentName(); - } - - /** - * Set the environmentName property: The multi cloud resource's cloud name. - * - * @param environmentName the environmentName value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEnvironmentName(CloudName environmentName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withEnvironmentName(environmentName); - 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 environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - public EnvironmentData environmentData() { - return this.innerProperties() == null ? null : this.innerProperties().environmentData(); - } - - /** - * Set the environmentData property: The security connector environment data. - * - * @param environmentData the environmentData value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEnvironmentData(EnvironmentData environmentData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withEnvironmentData(environmentData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityConnectorInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityConnectorInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SecurityConnectorInner. - */ - public static SecurityConnectorInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityConnectorInner deserializedSecurityConnectorInner = new SecurityConnectorInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityConnectorInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityConnectorInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityConnectorInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSecurityConnectorInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSecurityConnectorInner.withTags(tags); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityConnectorInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedSecurityConnectorInner.innerProperties = SecurityConnectorProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityConnectorInner; - }); - } -} 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 deleted file mode 100644 index 2b7129557a4a1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * A set of properties that defines the security connector configuration. - */ -@Fluent -public final class SecurityConnectorProperties implements JsonSerializable { - /* - * The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP - * connector). - */ - private String hierarchyIdentifier; - - /* - * The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to - * payed offerings. - */ - private OffsetDateTime hierarchyIdentifierTrialEndDate; - - /* - * The multi cloud resource's cloud name. - */ - private CloudName environmentName; - - /* - * A collection of offerings for the security connector. - */ - private List offerings; - - /* - * The security connector environment data. - */ - private EnvironmentData environmentData; - - /** - * Creates an instance of SecurityConnectorProperties class. - */ - public SecurityConnectorProperties() { - } - - /** - * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP 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, - * project number in case of GCP 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 hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.hierarchyIdentifierTrialEndDate; - } - - /** - * Get the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - public CloudName environmentName() { - return this.environmentName; - } - - /** - * Set the environmentName property: The multi cloud resource's cloud name. - * - * @param environmentName the environmentName value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withEnvironmentName(CloudName environmentName) { - this.environmentName = environmentName; - 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 environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - public EnvironmentData environmentData() { - return this.environmentData; - } - - /** - * Set the environmentData property: The security connector environment data. - * - * @param environmentData the environmentData value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withEnvironmentData(EnvironmentData environmentData) { - this.environmentData = environmentData; - 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 (environmentData() != null) { - environmentData().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("hierarchyIdentifier", this.hierarchyIdentifier); - jsonWriter.writeStringField("environmentName", - this.environmentName == null ? null : this.environmentName.toString()); - jsonWriter.writeArrayField("offerings", this.offerings, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("environmentData", this.environmentData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityConnectorProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityConnectorProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SecurityConnectorProperties. - */ - public static SecurityConnectorProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityConnectorProperties deserializedSecurityConnectorProperties = new SecurityConnectorProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("hierarchyIdentifier".equals(fieldName)) { - deserializedSecurityConnectorProperties.hierarchyIdentifier = reader.getString(); - } else if ("hierarchyIdentifierTrialEndDate".equals(fieldName)) { - deserializedSecurityConnectorProperties.hierarchyIdentifierTrialEndDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("environmentName".equals(fieldName)) { - deserializedSecurityConnectorProperties.environmentName = CloudName.fromString(reader.getString()); - } else if ("offerings".equals(fieldName)) { - List offerings = reader.readArray(reader1 -> CloudOffering.fromJson(reader1)); - deserializedSecurityConnectorProperties.offerings = offerings; - } else if ("environmentData".equals(fieldName)) { - deserializedSecurityConnectorProperties.environmentData = EnvironmentData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityConnectorProperties; - }); - } -} 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 deleted file mode 100644 index 54c610dd33943..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.NotificationsSource; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import java.io.IOException; -import java.util.List; - -/** - * Contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ -@Fluent -public final class SecurityContactInner extends ProxyResource { - /* - * Security contact data - */ - private SecurityContactProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SecurityContactInner class. - */ - public SecurityContactInner() { - } - - /** - * Get the innerProperties property: Security contact data. - * - * @return the innerProperties value. - */ - private SecurityContactProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - public String emails() { - return this.innerProperties() == null ? null : this.innerProperties().emails(); - } - - /** - * Set the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @param emails the emails value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withEmails(String emails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withEmails(emails); - return this; - } - - /** - * Get the phone property: The security contact's phone number. - * - * @return the phone value. - */ - public String phone() { - return this.innerProperties() == null ? null : this.innerProperties().phone(); - } - - /** - * Set the phone property: The security contact's phone number. - * - * @param phone the phone value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withPhone(String phone) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withPhone(phone); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security contact is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security contact is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - return this; - } - - /** - * Get the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @return the notificationsSources value. - */ - public List notificationsSources() { - return this.innerProperties() == null ? null : this.innerProperties().notificationsSources(); - } - - /** - * Set the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @param notificationsSources the notificationsSources value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withNotificationsSources(List notificationsSources) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withNotificationsSources(notificationsSources); - return this; - } - - /** - * Get the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.innerProperties() == null ? null : this.innerProperties().notificationsByRole(); - } - - /** - * Set the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @param notificationsByRole the notificationsByRole value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner - withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withNotificationsByRole(notificationsByRole); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityContactInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityContactInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SecurityContactInner. - */ - public static SecurityContactInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityContactInner deserializedSecurityContactInner = new SecurityContactInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityContactInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityContactInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityContactInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityContactInner.innerProperties = SecurityContactProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityContactInner; - }); - } -} 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 deleted file mode 100644 index 0aad3efbe0467..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.NotificationsSource; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import java.io.IOException; -import java.util.List; - -/** - * Describes security contact properties. - */ -@Fluent -public final class SecurityContactProperties implements JsonSerializable { - /* - * List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations - * defined in this security contact. - */ - private String emails; - - /* - * The security contact's phone number - */ - private String phone; - - /* - * Indicates whether the security contact is enabled. - */ - private Boolean isEnabled; - - /* - * A collection of sources types which evaluate the email notification. - */ - private List notificationsSources; - - /* - * Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles - * on the subscription. - */ - private SecurityContactPropertiesNotificationsByRole notificationsByRole; - - /** - * Creates an instance of SecurityContactProperties class. - */ - public SecurityContactProperties() { - } - - /** - * Get the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - public String emails() { - return this.emails; - } - - /** - * Set the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @param emails the emails value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withEmails(String emails) { - this.emails = emails; - return this; - } - - /** - * Get the phone property: The security contact's phone number. - * - * @return the phone value. - */ - public String phone() { - return this.phone; - } - - /** - * Set the phone property: The security contact's phone number. - * - * @param phone the phone value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withPhone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security contact is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether the security contact is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @return the notificationsSources value. - */ - public List notificationsSources() { - return this.notificationsSources; - } - - /** - * Set the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @param notificationsSources the notificationsSources value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withNotificationsSources(List notificationsSources) { - this.notificationsSources = notificationsSources; - return this; - } - - /** - * Get the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.notificationsByRole; - } - - /** - * Set the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @param notificationsByRole the notificationsByRole value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties - withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { - this.notificationsByRole = notificationsByRole; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (notificationsSources() != null) { - notificationsSources().forEach(e -> e.validate()); - } - if (notificationsByRole() != null) { - notificationsByRole().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("emails", this.emails); - jsonWriter.writeStringField("phone", this.phone); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeArrayField("notificationsSources", this.notificationsSources, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("notificationsByRole", this.notificationsByRole); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityContactProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityContactProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SecurityContactProperties. - */ - public static SecurityContactProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityContactProperties deserializedSecurityContactProperties = new SecurityContactProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("emails".equals(fieldName)) { - deserializedSecurityContactProperties.emails = reader.getString(); - } else if ("phone".equals(fieldName)) { - deserializedSecurityContactProperties.phone = reader.getString(); - } else if ("isEnabled".equals(fieldName)) { - deserializedSecurityContactProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("notificationsSources".equals(fieldName)) { - List notificationsSources - = reader.readArray(reader1 -> NotificationsSource.fromJson(reader1)); - deserializedSecurityContactProperties.notificationsSources = notificationsSources; - } else if ("notificationsByRole".equals(fieldName)) { - deserializedSecurityContactProperties.notificationsByRole - = SecurityContactPropertiesNotificationsByRole.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityContactProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java deleted file mode 100644 index da7865a572e53..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.Identity; -import java.io.IOException; - -/** - * Security operator under a given subscription and pricing. - */ -@Fluent -public final class SecurityOperatorInner extends ProxyResource { - /* - * Identity for the resource. - */ - private Identity identity; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SecurityOperatorInner class. - */ - public SecurityOperatorInner() { - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the SecurityOperatorInner object itself. - */ - public SecurityOperatorInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityOperatorInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityOperatorInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SecurityOperatorInner. - */ - public static SecurityOperatorInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityOperatorInner deserializedSecurityOperatorInner = new SecurityOperatorInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityOperatorInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityOperatorInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityOperatorInner.type = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedSecurityOperatorInner.identity = Identity.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityOperatorInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java deleted file mode 100644 index 139626de7dd7f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * List of SecurityOperator response. - */ -@Fluent -public final class SecurityOperatorListInner implements JsonSerializable { - /* - * List of SecurityOperator configurations - */ - private List value; - - /** - * Creates an instance of SecurityOperatorListInner class. - */ - public SecurityOperatorListInner() { - } - - /** - * Get the value property: List of SecurityOperator configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of SecurityOperator configurations. - * - * @param value the value value to set. - * @return the SecurityOperatorListInner object itself. - */ - public SecurityOperatorListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property value in model SecurityOperatorListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityOperatorListInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityOperatorListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityOperatorListInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SecurityOperatorListInner. - */ - public static SecurityOperatorListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityOperatorListInner deserializedSecurityOperatorListInner = new SecurityOperatorListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityOperatorInner.fromJson(reader1)); - deserializedSecurityOperatorListInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityOperatorListInner; - }); - } -} 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 deleted file mode 100644 index bb81440fefe90..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Security sub-assessment on a resource. - */ -@Fluent -public final class SecuritySubAssessmentInner extends ProxyResource { - /* - * Describes properties of an sub-assessment. - */ - private SecuritySubAssessmentProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SecuritySubAssessmentInner class. - */ - public SecuritySubAssessmentInner() { - } - - /** - * Get the innerProperties property: Describes properties of an sub-assessment. - * - * @return the innerProperties value. - */ - private SecuritySubAssessmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the id property: Vulnerability ID. - * - * @return the id value. - */ - public String idPropertiesId() { - return this.innerProperties() == null ? null : this.innerProperties().id(); - } - - /** - * Get the displayName property: User friendly display name of the sub-assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the status property: Status of the sub-assessment. - * - * @return the status value. - */ - public SubAssessmentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status of the sub-assessment. - * - * @param status the status value to set. - * @return the SecuritySubAssessmentInner object itself. - */ - public SecuritySubAssessmentInner withStatus(SubAssessmentStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySubAssessmentProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the remediation property: Information on how to remediate this sub-assessment. - * - * @return the remediation value. - */ - public String remediation() { - return this.innerProperties() == null ? null : this.innerProperties().remediation(); - } - - /** - * Get the impact property: Description of the impact of this sub-assessment. - * - * @return the impact value. - */ - public String impact() { - return this.innerProperties() == null ? null : this.innerProperties().impact(); - } - - /** - * Get the category property: Category of the sub-assessment. - * - * @return the category value. - */ - public String category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the timeGenerated property: The date and time the sub-assessment was generated. - * - * @return the timeGenerated value. - */ - public OffsetDateTime timeGenerated() { - return this.innerProperties() == null ? null : this.innerProperties().timeGenerated(); - } - - /** - * 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 SecuritySubAssessmentInner object itself. - */ - public SecuritySubAssessmentInner withResourceDetails(ResourceDetails resourceDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySubAssessmentProperties(); - } - this.innerProperties().withResourceDetails(resourceDetails); - return this; - } - - /** - * Get the additionalData property: Details of the sub-assessment. - * - * @return the additionalData value. - */ - public AdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Details of the sub-assessment. - * - * @param additionalData the additionalData value to set. - * @return the SecuritySubAssessmentInner object itself. - */ - public SecuritySubAssessmentInner withAdditionalData(AdditionalData additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySubAssessmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuritySubAssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySubAssessmentInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SecuritySubAssessmentInner. - */ - public static SecuritySubAssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySubAssessmentInner deserializedSecuritySubAssessmentInner = new SecuritySubAssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.innerProperties - = SecuritySubAssessmentProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySubAssessmentInner; - }); - } -} 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 deleted file mode 100644 index 91117c88d7a17..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes properties of an sub-assessment. - */ -@Fluent -public final class SecuritySubAssessmentProperties implements JsonSerializable { - /* - * Vulnerability ID - */ - private String id; - - /* - * User friendly display name of the sub-assessment - */ - private String displayName; - - /* - * Status of the sub-assessment - */ - private SubAssessmentStatus status; - - /* - * Information on how to remediate this sub-assessment - */ - private String remediation; - - /* - * Description of the impact of this sub-assessment - */ - private String impact; - - /* - * Category of the sub-assessment - */ - private String category; - - /* - * Human readable description of the assessment status - */ - private String description; - - /* - * The date and time the sub-assessment was generated - */ - private OffsetDateTime timeGenerated; - - /* - * Details of the resource that was assessed - */ - private ResourceDetails resourceDetails; - - /* - * Details of the sub-assessment - */ - private AdditionalData additionalData; - - /** - * Creates an instance of SecuritySubAssessmentProperties class. - */ - public SecuritySubAssessmentProperties() { - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("status", this.status); - jsonWriter.writeJsonField("resourceDetails", this.resourceDetails); - jsonWriter.writeJsonField("additionalData", this.additionalData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuritySubAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySubAssessmentProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SecuritySubAssessmentProperties. - */ - public static SecuritySubAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySubAssessmentProperties deserializedSecuritySubAssessmentProperties - = new SecuritySubAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.id = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.displayName = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.status = SubAssessmentStatus.fromJson(reader); - } else if ("remediation".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.remediation = reader.getString(); - } else if ("impact".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.impact = reader.getString(); - } else if ("category".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.category = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.description = reader.getString(); - } else if ("timeGenerated".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.timeGenerated = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("resourceDetails".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.resourceDetails = ResourceDetails.fromJson(reader); - } else if ("additionalData".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.additionalData = AdditionalData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySubAssessmentProperties; - }); - } -} 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 deleted file mode 100644 index 4fc28dc4a262e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Security task that we recommend to do in order to strengthen security. - */ -@Fluent -public final class SecurityTaskInner extends ProxyResource { - /* - * Describes properties of a task. - */ - private SecurityTaskProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SecurityTaskInner class. - */ - public SecurityTaskInner() { - } - - /** - * Get the innerProperties property: Describes properties of a task. - * - * @return the innerProperties value. - */ - private SecurityTaskProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the state property: State of the task (Active, Resolved etc.). - * - * @return the state value. - */ - public String state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the creationTimeUtc property: The time this task was discovered in UTC. - * - * @return the creationTimeUtc value. - */ - public OffsetDateTime creationTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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 SecurityTaskInner object itself. - */ - public SecurityTaskInner withSecurityTaskParameters(SecurityTaskParameters securityTaskParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityTaskProperties(); - } - this.innerProperties().withSecurityTaskParameters(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.innerProperties() == null ? null : this.innerProperties().lastStateChangeTimeUtc(); - } - - /** - * Get the subState property: Additional data on the state of the task. - * - * @return the subState value. - */ - public String subState() { - return this.innerProperties() == null ? null : this.innerProperties().subState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityTaskInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityTaskInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SecurityTaskInner. - */ - public static SecurityTaskInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityTaskInner deserializedSecurityTaskInner = new SecurityTaskInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityTaskInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityTaskInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityTaskInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityTaskInner.innerProperties = SecurityTaskProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityTaskInner; - }); - } -} 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 deleted file mode 100644 index 304fcb6ef7240..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.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.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes properties of a task. - */ -@Fluent -public final class SecurityTaskProperties implements JsonSerializable { - /* - * State of the task (Active, Resolved etc.) - */ - private String state; - - /* - * The time this task was discovered in UTC - */ - private OffsetDateTime creationTimeUtc; - - /* - * Changing set of properties, depending on the task type that is derived from the name field - */ - private SecurityTaskParameters securityTaskParameters; - - /* - * The time this task's details were last changed in UTC - */ - private OffsetDateTime lastStateChangeTimeUtc; - - /* - * Additional data on the state of the task - */ - private String subState; - - /** - * Creates an instance of SecurityTaskProperties class. - */ - public SecurityTaskProperties() { - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("securityTaskParameters", this.securityTaskParameters); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityTaskProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityTaskProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the SecurityTaskProperties. - */ - public static SecurityTaskProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityTaskProperties deserializedSecurityTaskProperties = new SecurityTaskProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedSecurityTaskProperties.state = reader.getString(); - } else if ("creationTimeUtc".equals(fieldName)) { - deserializedSecurityTaskProperties.creationTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("securityTaskParameters".equals(fieldName)) { - deserializedSecurityTaskProperties.securityTaskParameters = SecurityTaskParameters.fromJson(reader); - } else if ("lastStateChangeTimeUtc".equals(fieldName)) { - deserializedSecurityTaskProperties.lastStateChangeTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("subState".equals(fieldName)) { - deserializedSecurityTaskProperties.subState = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityTaskProperties; - }); - } -} 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 deleted file mode 100644 index 4efd7f5a975c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import java.io.IOException; - -/** - * Represents a software data. - */ -@Fluent -public final class SoftwareInner extends ProxyResource { - /* - * Properties of the Software Inventory resource - */ - private SoftwareProperties innerProperties = new SoftwareProperties(); - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SoftwareInner class. - */ - public SoftwareInner() { - } - - /** - * Get the innerProperties property: Properties of the Software Inventory resource. - * - * @return the innerProperties value. - */ - private SoftwareProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the deviceId property: Unique identifier for the virtual machine in the service. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.innerProperties() == null ? null : this.innerProperties().deviceId(); - } - - /** - * Set the deviceId property: Unique identifier for the virtual machine in the service. - * - * @param deviceId the deviceId value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withDeviceId(String deviceId) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withDeviceId(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.innerProperties() == null ? null : this.innerProperties().osPlatform(); - } - - /** - * Set the osPlatform property: Platform of the operating system running on the device. - * - * @param osPlatform the osPlatform value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withOsPlatform(String osPlatform) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withOsPlatform(osPlatform); - return this; - } - - /** - * Get the vendor property: Name of the software vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.innerProperties() == null ? null : this.innerProperties().vendor(); - } - - /** - * Set the vendor property: Name of the software vendor. - * - * @param vendor the vendor value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withVendor(String vendor) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withVendor(vendor); - return this; - } - - /** - * Get the softwareName property: Name of the software product. - * - * @return the softwareName value. - */ - public String softwareName() { - return this.innerProperties() == null ? null : this.innerProperties().softwareName(); - } - - /** - * Set the softwareName property: Name of the software product. - * - * @param softwareName the softwareName value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withSoftwareName(String softwareName) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withSoftwareName(softwareName); - return this; - } - - /** - * Get the version property: Version number of the software product. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Set the version property: Version number of the software product. - * - * @param version the version value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withVersion(String version) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - - /** - * Get the endOfSupportStatus property: End of support status. - * - * @return the endOfSupportStatus value. - */ - public EndOfSupportStatus endOfSupportStatus() { - return this.innerProperties() == null ? null : this.innerProperties().endOfSupportStatus(); - } - - /** - * Set the endOfSupportStatus property: End of support status. - * - * @param endOfSupportStatus the endOfSupportStatus value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withEndOfSupportStatus(EndOfSupportStatus endOfSupportStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withEndOfSupportStatus(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.innerProperties() == null ? null : this.innerProperties().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 SoftwareInner object itself. - */ - public SoftwareInner withEndOfSupportDate(String endOfSupportDate) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withEndOfSupportDate(endOfSupportDate); - return this; - } - - /** - * Get the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @return the numberOfKnownVulnerabilities value. - */ - public Integer numberOfKnownVulnerabilities() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfKnownVulnerabilities(); - } - - /** - * Set the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @param numberOfKnownVulnerabilities the numberOfKnownVulnerabilities value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withNumberOfKnownVulnerabilities(Integer numberOfKnownVulnerabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withNumberOfKnownVulnerabilities(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.innerProperties() == null ? null : this.innerProperties().firstSeenAt(); - } - - /** - * Set the firstSeenAt property: First time that the software was seen in the device. - * - * @param firstSeenAt the firstSeenAt value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withFirstSeenAt(String firstSeenAt) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withFirstSeenAt(firstSeenAt); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model SoftwareInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SoftwareInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SoftwareInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SoftwareInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SoftwareInner. - */ - public static SoftwareInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SoftwareInner deserializedSoftwareInner = new SoftwareInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSoftwareInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSoftwareInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSoftwareInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSoftwareInner.innerProperties = SoftwareProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSoftwareInner; - }); - } -} 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 deleted file mode 100644 index 523cb90edb9bf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import java.io.IOException; - -/** - * Software Inventory resource properties. - */ -@Fluent -public final class SoftwareProperties implements JsonSerializable { - /* - * Unique identifier for the virtual machine in the service. - */ - private String deviceId; - - /* - * Platform of the operating system running on the device. - */ - private String osPlatform; - - /* - * Name of the software vendor. - */ - private String vendor; - - /* - * Name of the software product. - */ - private String softwareName; - - /* - * Version number of the software product. - */ - private String version; - - /* - * End of support status. - */ - private EndOfSupportStatus endOfSupportStatus; - - /* - * The end of support date in case the product is upcoming end of support. - */ - private String endOfSupportDate; - - /* - * Number of weaknesses. - */ - private Integer numberOfKnownVulnerabilities; - - /* - * First time that the software was seen in the device. - */ - private String firstSeenAt; - - /** - * Creates an instance of SoftwareProperties class. - */ - public SoftwareProperties() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deviceId", this.deviceId); - jsonWriter.writeStringField("osPlatform", this.osPlatform); - jsonWriter.writeStringField("vendor", this.vendor); - jsonWriter.writeStringField("softwareName", this.softwareName); - jsonWriter.writeStringField("version", this.version); - jsonWriter.writeStringField("endOfSupportStatus", - this.endOfSupportStatus == null ? null : this.endOfSupportStatus.toString()); - jsonWriter.writeStringField("endOfSupportDate", this.endOfSupportDate); - jsonWriter.writeNumberField("numberOfKnownVulnerabilities", this.numberOfKnownVulnerabilities); - jsonWriter.writeStringField("firstSeenAt", this.firstSeenAt); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SoftwareProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SoftwareProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SoftwareProperties. - */ - public static SoftwareProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SoftwareProperties deserializedSoftwareProperties = new SoftwareProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceId".equals(fieldName)) { - deserializedSoftwareProperties.deviceId = reader.getString(); - } else if ("osPlatform".equals(fieldName)) { - deserializedSoftwareProperties.osPlatform = reader.getString(); - } else if ("vendor".equals(fieldName)) { - deserializedSoftwareProperties.vendor = reader.getString(); - } else if ("softwareName".equals(fieldName)) { - deserializedSoftwareProperties.softwareName = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedSoftwareProperties.version = reader.getString(); - } else if ("endOfSupportStatus".equals(fieldName)) { - deserializedSoftwareProperties.endOfSupportStatus - = EndOfSupportStatus.fromString(reader.getString()); - } else if ("endOfSupportDate".equals(fieldName)) { - deserializedSoftwareProperties.endOfSupportDate = reader.getString(); - } else if ("numberOfKnownVulnerabilities".equals(fieldName)) { - deserializedSoftwareProperties.numberOfKnownVulnerabilities - = reader.getNullable(JsonReader::getInt); - } else if ("firstSeenAt".equals(fieldName)) { - deserializedSoftwareProperties.firstSeenAt = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSoftwareProperties; - }); - } -} 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 deleted file mode 100644 index 403dcdbd58a04..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Configures where to store the OMS agent data for workspaces under a scope. - */ -@Fluent -public final class WorkspaceSettingInner extends ProxyResource { - /* - * Workspace setting data - */ - private WorkspaceSettingProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of WorkspaceSettingInner class. - */ - public WorkspaceSettingInner() { - } - - /** - * Get the innerProperties property: Workspace setting data. - * - * @return the innerProperties value. - */ - private WorkspaceSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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.innerProperties() == null ? null : this.innerProperties().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 WorkspaceSettingInner object itself. - */ - public WorkspaceSettingInner withWorkspaceId(String workspaceId) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceSettingProperties(); - } - this.innerProperties().withWorkspaceId(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.innerProperties() == null ? null : this.innerProperties().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 WorkspaceSettingInner object itself. - */ - public WorkspaceSettingInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceSettingProperties(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkspaceSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkspaceSettingInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WorkspaceSettingInner. - */ - public static WorkspaceSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkspaceSettingInner deserializedWorkspaceSettingInner = new WorkspaceSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedWorkspaceSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedWorkspaceSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedWorkspaceSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedWorkspaceSettingInner.innerProperties = WorkspaceSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkspaceSettingInner; - }); - } -} 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 deleted file mode 100644 index 706f12a15eab8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Workspace setting data. - */ -@Fluent -public final class WorkspaceSettingProperties implements JsonSerializable { - /* - * The full Azure ID of the workspace to save the data in - */ - 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 - */ - private String scope; - - /** - * Creates an instance of WorkspaceSettingProperties class. - */ - public WorkspaceSettingProperties() { - } - - /** - * 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.atError() - .log(new IllegalArgumentException( - "Missing required property workspaceId in model WorkspaceSettingProperties")); - } - if (scope() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property scope in model WorkspaceSettingProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("workspaceId", this.workspaceId); - jsonWriter.writeStringField("scope", this.scope); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkspaceSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkspaceSettingProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WorkspaceSettingProperties. - */ - public static WorkspaceSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkspaceSettingProperties deserializedWorkspaceSettingProperties = new WorkspaceSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workspaceId".equals(fieldName)) { - deserializedWorkspaceSettingProperties.workspaceId = reader.getString(); - } else if ("scope".equals(fieldName)) { - deserializedWorkspaceSettingProperties.scope = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkspaceSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java deleted file mode 100644 index 5fbf105426f57..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; - -public final class AlertsSuppressionRuleImpl implements AlertsSuppressionRule { - private AlertsSuppressionRuleInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AlertsSuppressionRuleImpl(AlertsSuppressionRuleInner 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 alertType() { - return this.innerModel().alertType(); - } - - public OffsetDateTime lastModifiedUtc() { - return this.innerModel().lastModifiedUtc(); - } - - public OffsetDateTime expirationDateUtc() { - return this.innerModel().expirationDateUtc(); - } - - public String reason() { - return this.innerModel().reason(); - } - - public RuleState state() { - return this.innerModel().state(); - } - - public String comment() { - return this.innerModel().comment(); - } - - public SuppressionAlertsScope suppressionAlertsScope() { - return this.innerModel().suppressionAlertsScope(); - } - - public AlertsSuppressionRuleInner 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/AlertsSuppressionRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java deleted file mode 100644 index 145734ce7209d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java +++ /dev/null @@ -1,638 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRulesList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. - */ -public final class AlertsSuppressionRulesClientImpl implements AlertsSuppressionRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final AlertsSuppressionRulesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AlertsSuppressionRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertsSuppressionRulesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AlertsSuppressionRulesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAlertsSuppressionRules to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAlerts") - public interface AlertsSuppressionRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("AlertType") String alertType, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @BodyParam("application/json") AlertsSuppressionRuleInner alertsSuppressionRule, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @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 of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String alertType) { - 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 = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertType, 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 of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String alertType, 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 = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), alertType, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String alertType) { - return new PagedFlux<>(() -> listSinglePageAsync(alertType), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String alertType = null; - return new PagedFlux<>(() -> listSinglePageAsync(alertType), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String alertType, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(alertType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String alertType = null; - return new PagedIterable<>(listAsync(alertType)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String alertType, Context context) { - return new PagedIterable<>(listAsync(alertType, context)); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String alertsSuppressionRuleName) { - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String alertsSuppressionRuleName, - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, accept, context); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String alertsSuppressionRuleName) { - return getWithResponseAsync(alertsSuppressionRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - return getWithResponseAsync(alertsSuppressionRuleName, context).block(); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner get(String alertsSuppressionRuleName) { - return getWithResponse(alertsSuppressionRuleName, Context.NONE).getValue(); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - if (alertsSuppressionRule == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertsSuppressionRule is required and cannot be null.")); - } else { - alertsSuppressionRule.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), alertsSuppressionRuleName, alertsSuppressionRule, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - if (alertsSuppressionRule == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertsSuppressionRule is required and cannot be null.")); - } else { - alertsSuppressionRule.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, alertsSuppressionRule, accept, context); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - return updateWithResponseAsync(alertsSuppressionRuleName, alertsSuppressionRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - return updateWithResponseAsync(alertsSuppressionRuleName, alertsSuppressionRule, context).block(); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner update(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - return updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, Context.NONE).getValue(); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String alertsSuppressionRuleName) { - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), alertsSuppressionRuleName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String alertsSuppressionRuleName, 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, accept, context); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String alertsSuppressionRuleName) { - return deleteWithResponseAsync(alertsSuppressionRuleName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String alertsSuppressionRuleName, Context context) { - return deleteWithResponseAsync(alertsSuppressionRuleName, context).block(); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 alertsSuppressionRuleName) { - deleteWithResponse(alertsSuppressionRuleName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java deleted file mode 100644 index 353fe376e1f6a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.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.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.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.AlertsSuppressionRules; - -public final class AlertsSuppressionRulesImpl implements AlertsSuppressionRules { - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRulesImpl.class); - - private final AlertsSuppressionRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AlertsSuppressionRulesImpl(AlertsSuppressionRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String alertType, Context context) { - PagedIterable inner = this.serviceClient().list(alertType, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - Response inner - = this.serviceClient().getWithResponse(alertsSuppressionRuleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AlertsSuppressionRule get(String alertsSuppressionRuleName) { - AlertsSuppressionRuleInner inner = this.serviceClient().get(alertsSuppressionRuleName); - if (inner != null) { - return new AlertsSuppressionRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - Response inner - = this.serviceClient().updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AlertsSuppressionRule update(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - AlertsSuppressionRuleInner inner - = this.serviceClient().update(alertsSuppressionRuleName, alertsSuppressionRule); - if (inner != null) { - return new AlertsSuppressionRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String alertsSuppressionRuleName, Context context) { - return this.serviceClient().deleteWithResponse(alertsSuppressionRuleName, context); - } - - public void delete(String alertsSuppressionRuleName) { - this.serviceClient().delete(alertsSuppressionRuleName); - } - - private AlertsSuppressionRulesClient 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/ApplicationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java deleted file mode 100644 index ccd43af051f85..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Collections; -import java.util.List; - -public final class ApplicationImpl implements Application, Application.Definition, Application.Update { - private ApplicationInner 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 displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public ApplicationSourceResourceType sourceResourceType() { - return this.innerModel().sourceResourceType(); - } - - public List conditionSets() { - List inner = this.innerModel().conditionSets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ApplicationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String applicationId; - - public Application create() { - this.innerObject = serviceManager.serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Application create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); - return this; - } - - ApplicationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new ApplicationInner(); - this.serviceManager = serviceManager; - this.applicationId = name; - } - - public ApplicationImpl update() { - return this; - } - - public Application apply() { - this.innerObject = serviceManager.serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Application apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); - return this; - } - - ApplicationImpl(ApplicationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.applicationId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); - } - - public Application refresh() { - this.innerObject = serviceManager.serviceClient() - .getApplicationOperations() - .getWithResponse(applicationId, Context.NONE) - .getValue(); - return this; - } - - public Application refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getApplicationOperations() - .getWithResponse(applicationId, context) - .getValue(); - return this; - } - - public ApplicationImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public ApplicationImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public ApplicationImpl withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - this.innerModel().withSourceResourceType(sourceResourceType); - return this; - } - - public ApplicationImpl withConditionSets(List conditionSets) { - this.innerModel().withConditionSets(conditionSets); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java deleted file mode 100644 index 2dee16d2c2d36..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright (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.resourcemanager.security.fluent.ApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ApplicationOperationsClient. - */ -public final class ApplicationOperationsClientImpl implements ApplicationOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ApplicationOperationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApplicationOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationOperationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(ApplicationOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApplicationOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApplic") - public interface ApplicationOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, - @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("applicationId") String applicationId, - Context context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String applicationId) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - applicationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String applicationId, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), applicationId, - accept, context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String applicationId) { - return getWithResponseAsync(applicationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String applicationId, Context context) { - return getWithResponseAsync(applicationId, context).block(); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String applicationId) { - return getWithResponse(applicationId, Context.NONE).getValue(); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String applicationId, - ApplicationInner application) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), applicationId, application, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String applicationId, - ApplicationInner application, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - applicationId, application, accept, context); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String applicationId, ApplicationInner application) { - return createOrUpdateWithResponseAsync(applicationId, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String applicationId, ApplicationInner application, - Context context) { - return createOrUpdateWithResponseAsync(applicationId, application, context).block(); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate(String applicationId, ApplicationInner application) { - return createOrUpdateWithResponse(applicationId, application, Context.NONE).getValue(); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String applicationId) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), applicationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String applicationId, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), applicationId, - context); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String applicationId) { - return deleteWithResponseAsync(applicationId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String applicationId, Context context) { - return deleteWithResponseAsync(applicationId, context).block(); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 applicationId) { - deleteWithResponse(applicationId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java deleted file mode 100644 index fb1cc5d536bb5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.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.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.ApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationOperations; - -public final class ApplicationOperationsImpl implements ApplicationOperations { - private static final ClientLogger LOGGER = new ClientLogger(ApplicationOperationsImpl.class); - - private final ApplicationOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApplicationOperationsImpl(ApplicationOperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String applicationId, Context context) { - Response inner = this.serviceClient().getWithResponse(applicationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Application get(String applicationId) { - ApplicationInner inner = this.serviceClient().get(applicationId); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String applicationId, Context context) { - return this.serviceClient().deleteWithResponse(applicationId, context); - } - - public void delete(String applicationId) { - this.serviceClient().delete(applicationId); - } - - public Application getById(String id) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(applicationId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(applicationId, context); - } - - public void deleteById(String id) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - this.deleteWithResponse(applicationId, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.deleteWithResponse(applicationId, context); - } - - private ApplicationOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public ApplicationImpl define(String name) { - return new ApplicationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java deleted file mode 100644 index cc4a9e98d4ba0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ApplicationsClient. - */ -public final class ApplicationsClientImpl implements ApplicationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ApplicationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApplications to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApplic") - public interface ApplicationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-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())); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-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)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security applications list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security applications list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java deleted file mode 100644 index 94842779359ea..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.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.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.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.Applications; - -public final class ApplicationsImpl implements Applications { - private static final ClientLogger LOGGER = new ClientLogger(ApplicationsImpl.class); - - private final ApplicationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApplicationsImpl(ApplicationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - private ApplicationsClient 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/AscLocationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java deleted file mode 100644 index 557b0b5b19e07..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocation; - -public final class AscLocationImpl implements AscLocation { - private AscLocationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AscLocationImpl(AscLocationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Object properties() { - return this.innerModel().properties(); - } - - public AscLocationInner 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/AutoProvisioningSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java deleted file mode 100644 index 772b0a9b0fdeb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.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.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; - -public final class AutoProvisioningSettingImpl implements AutoProvisioningSetting, AutoProvisioningSetting.Definition { - private AutoProvisioningSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AutoProvisioningSettingImpl(AutoProvisioningSettingInner 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 AutoProvision autoProvision() { - return this.innerModel().autoProvision(); - } - - public AutoProvisioningSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String settingName; - - public AutoProvisioningSetting create() { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AutoProvisioningSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), context) - .getValue(); - return this; - } - - AutoProvisioningSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AutoProvisioningSettingInner(); - this.serviceManager = serviceManager; - this.settingName = name; - } - - public AutoProvisioningSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, Context.NONE) - .getValue(); - return this; - } - - public AutoProvisioningSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, context) - .getValue(); - return this; - } - - public AutoProvisioningSettingImpl withAutoProvision(AutoProvision autoProvision) { - this.innerModel().withAutoProvision(autoProvision); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java deleted file mode 100644 index 76b6435ce763e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvisioningSettingList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. - */ -public final class AutoProvisioningSettingsClientImpl implements AutoProvisioningSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AutoProvisioningSettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AutoProvisioningSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutoProvisioningSettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AutoProvisioningSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAutoProvisioningSettings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAutoPr") - public interface AutoProvisioningSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings") - @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/autoProvisioningSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, - @BodyParam("application/json") AutoProvisioningSettingInner setting, @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); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-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())); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-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)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String settingName) { - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String settingName, 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, accept, - context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String settingName) { - return getWithResponseAsync(settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String settingName, Context context) { - return getWithResponseAsync(settingName, context).block(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoProvisioningSettingInner get(String settingName) { - return getWithResponse(settingName, Context.NONE).getValue(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String settingName, - AutoProvisioningSettingInner setting) { - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), settingName, setting, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String settingName, - AutoProvisioningSettingInner setting, 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, - setting, accept, context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String settingName, AutoProvisioningSettingInner setting) { - return createWithResponseAsync(settingName, setting).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String settingName, - AutoProvisioningSettingInner setting, Context context) { - return createWithResponseAsync(settingName, setting, context).block(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoProvisioningSettingInner create(String settingName, AutoProvisioningSettingInner setting) { - return createWithResponse(settingName, setting, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java deleted file mode 100644 index 6f422238d33ed..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.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.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.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import com.azure.resourcemanager.security.models.AutoProvisioningSettings; - -public final class AutoProvisioningSettingsImpl implements AutoProvisioningSettings { - private static final ClientLogger LOGGER = new ClientLogger(AutoProvisioningSettingsImpl.class); - - private final AutoProvisioningSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AutoProvisioningSettingsImpl(AutoProvisioningSettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String settingName, Context context) { - Response inner = this.serviceClient().getWithResponse(settingName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AutoProvisioningSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AutoProvisioningSetting get(String settingName) { - AutoProvisioningSettingInner inner = this.serviceClient().get(settingName); - if (inner != null) { - return new AutoProvisioningSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public AutoProvisioningSetting getById(String id) { - String settingName = ResourceManagerUtils.getValueFromIdByName(id, "autoProvisioningSettings"); - if (settingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", id))); - } - return this.getWithResponse(settingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String settingName = ResourceManagerUtils.getValueFromIdByName(id, "autoProvisioningSettings"); - if (settingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", id))); - } - return this.getWithResponse(settingName, context); - } - - private AutoProvisioningSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AutoProvisioningSettingImpl define(String name) { - return new AutoProvisioningSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java deleted file mode 100644 index d3ff240c37850..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (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.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationUpdateModel; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class AutomationImpl implements Automation, Automation.Definition, Automation.Update { - private AutomationInner 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 String description() { - return this.innerModel().description(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public List scopes() { - List inner = this.innerModel().scopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List sources() { - List inner = this.innerModel().sources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List actions() { - List inner = this.innerModel().actions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AutomationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String automationName; - - private AutomationUpdateModel updateAutomation; - - public AutomationImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Automation create() { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Automation create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), context) - .getValue(); - return this; - } - - AutomationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AutomationInner(); - this.serviceManager = serviceManager; - this.automationName = name; - } - - public AutomationImpl update() { - this.updateAutomation = new AutomationUpdateModel(); - return this; - } - - public Automation apply() { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .updateWithResponse(resourceGroupName, automationName, updateAutomation, Context.NONE) - .getValue(); - return this; - } - - public Automation apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .updateWithResponse(resourceGroupName, automationName, updateAutomation, context) - .getValue(); - return this; - } - - AutomationImpl(AutomationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.automationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "automations"); - } - - public Automation refresh() { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE) - .getValue(); - return this; - } - - public Automation refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .getByResourceGroupWithResponse(resourceGroupName, automationName, context) - .getValue(); - return this; - } - - public Response validateWithResponse(AutomationInner automation, Context context) { - return serviceManager.automations() - .validateWithResponse(resourceGroupName, automationName, automation, context); - } - - public AutomationValidationStatus validate(AutomationInner automation) { - return serviceManager.automations().validate(resourceGroupName, automationName, automation); - } - - public AutomationImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public AutomationImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public AutomationImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateAutomation.withTags(tags); - return this; - } - } - - public AutomationImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateAutomation.withDescription(description); - return this; - } - } - - public AutomationImpl withIsEnabled(Boolean isEnabled) { - if (isInCreateMode()) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } else { - this.updateAutomation.withIsEnabled(isEnabled); - return this; - } - } - - public AutomationImpl withScopes(List scopes) { - if (isInCreateMode()) { - this.innerModel().withScopes(scopes); - return this; - } else { - this.updateAutomation.withScopes(scopes); - return this; - } - } - - public AutomationImpl withSources(List sources) { - if (isInCreateMode()) { - this.innerModel().withSources(sources); - return this; - } else { - this.updateAutomation.withSources(sources); - return this; - } - } - - public AutomationImpl withActions(List actions) { - if (isInCreateMode()) { - this.innerModel().withActions(actions); - return this; - } else { - this.updateAutomation.withActions(actions); - 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/AutomationValidationStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java deleted file mode 100644 index 62257fd6317d7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; - -public final class AutomationValidationStatusImpl implements AutomationValidationStatus { - private AutomationValidationStatusInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AutomationValidationStatusImpl(AutomationValidationStatusInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean isValid() { - return this.innerModel().isValid(); - } - - public String message() { - return this.innerModel().message(); - } - - public AutomationValidationStatusInner 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/AutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java deleted file mode 100644 index 366f73f1c391b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java +++ /dev/null @@ -1,1203 +0,0 @@ -// Copyright (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.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationList; -import com.azure.resourcemanager.security.models.AutomationUpdateModel; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AutomationsClient. - */ -public final class AutomationsClientImpl implements AutomationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AutomationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AutomationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutomationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAutomations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAutoma") - public interface AutomationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations") - @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/automations") - @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/automations/{automationName}") - @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("automationName") String automationName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @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("automationName") String automationName, - @BodyParam("application/json") AutomationInner automation, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @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("automationName") String automationName, - @BodyParam("application/json") AutomationUpdateModel automation, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @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("automationName") String automationName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, - @BodyParam("application/json") AutomationInner automation, @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 automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-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 automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-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 automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 = "2023-12-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 automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 = "2023-12-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 automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedFlux}. - */ - @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 automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String automationName) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String automationName, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, accept, context); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String automationName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, automationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, automationName, context).block(); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner getByResourceGroup(String resourceGroupName, String automationName) { - return getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE).getValue(); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, automation, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, automation, accept, context); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String automationName, - AutomationInner automation) { - return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation 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 automationName The security automation name. - * @param automation The security automation 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 automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation) { - return createOrUpdateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String automationName, - AutomationUpdateModel automation) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, automation, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String automationName, - AutomationUpdateModel automation, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - automationName, automation, accept, context); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String automationName, - AutomationUpdateModel automation) { - return updateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String automationName, - AutomationUpdateModel automation, Context context) { - return updateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner update(String resourceGroupName, String automationName, AutomationUpdateModel automation) { - return updateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String automationName) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String automationName, - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - automationName, accept, context); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String automationName) { - return deleteWithResponseAsync(resourceGroupName, automationName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String automationName, Context context) { - return deleteWithResponseAsync(resourceGroupName, automationName, context).block(); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automationName) { - deleteWithResponse(resourceGroupName, automationName, Context.NONE); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, automation, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, automation, accept, context); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String resourceGroupName, String automationName, - AutomationInner automation) { - return validateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(String resourceGroupName, - String automationName, AutomationInner automation, Context context) { - return validateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationValidationStatusInner validate(String resourceGroupName, String automationName, - AutomationInner automation) { - return validateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} 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 deleted file mode 100644 index e76dfb3dd1cb0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (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.AutomationsClient; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import com.azure.resourcemanager.security.models.Automations; - -public final class AutomationsImpl implements Automations { - private static final ClientLogger LOGGER = new ClientLogger(AutomationsImpl.class); - - private final AutomationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AutomationsImpl(AutomationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, automationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AutomationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Automation getByResourceGroup(String resourceGroupName, String automationName) { - AutomationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, automationName); - if (inner != null) { - return new AutomationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, automationName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String automationName) { - this.serviceClient().delete(resourceGroupName, automationName); - } - - public Response validateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context) { - Response inner - = this.serviceClient().validateWithResponse(resourceGroupName, automationName, automation, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AutomationValidationStatusImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AutomationValidationStatus validate(String resourceGroupName, String automationName, - AutomationInner automation) { - AutomationValidationStatusInner inner - = this.serviceClient().validate(resourceGroupName, automationName, automation); - if (inner != null) { - return new AutomationValidationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public Automation getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, automationName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, automationName, context); - } - - private AutomationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AutomationImpl define(String name) { - return new AutomationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java deleted file mode 100644 index 3a03fd4e6f7cb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.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.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; - -public final class AzureDevOpsOrgImpl implements AzureDevOpsOrg, AzureDevOpsOrg.Definition, AzureDevOpsOrg.Update { - private AzureDevOpsOrgInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AzureDevOpsOrgProperties properties() { - return this.innerModel().properties(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureDevOpsOrgInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String orgName; - - public AzureDevOpsOrgImpl withExistingSecurityConnector(String resourceGroupName, String securityConnectorName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - return this; - } - - public AzureDevOpsOrg create() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, this.innerModel(), Context.NONE); - return this; - } - - public AzureDevOpsOrg create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, this.innerModel(), context); - return this; - } - - AzureDevOpsOrgImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AzureDevOpsOrgInner(); - this.serviceManager = serviceManager; - this.orgName = name; - } - - public AzureDevOpsOrgImpl update() { - return this; - } - - public AzureDevOpsOrg apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .update(resourceGroupName, securityConnectorName, orgName, this.innerModel(), Context.NONE); - return this; - } - - public AzureDevOpsOrg apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .update(resourceGroupName, securityConnectorName, orgName, this.innerModel(), context); - return this; - } - - AzureDevOpsOrgImpl(AzureDevOpsOrgInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); - } - - public AzureDevOpsOrg refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE) - .getValue(); - return this; - } - - public AzureDevOpsOrg refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, context) - .getValue(); - return this; - } - - public AzureDevOpsOrgImpl withProperties(AzureDevOpsOrgProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java deleted file mode 100644 index 5c34831e7124b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.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.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgListResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class AzureDevOpsOrgListResponseImpl implements AzureDevOpsOrgListResponse { - private AzureDevOpsOrgListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AzureDevOpsOrgListResponseImpl(AzureDevOpsOrgListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public AzureDevOpsOrgListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java deleted file mode 100644 index 97ca4a1d6b773..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java +++ /dev/null @@ -1,1102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.AzureDevOpsOrgsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsOrgsClient. - */ -public final class AzureDevOpsOrgsClientImpl implements AzureDevOpsOrgsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureDevOpsOrgsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AzureDevOpsOrgsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureDevOpsOrgsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AzureDevOpsOrgsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAzureDevOpsOrgs to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAzureD") - public interface AzureDevOpsOrgsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableAzureDevOpsOrgs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, accept, context); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableAsync(String resourceGroupName, - String securityConnectorName) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { - return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, apiVersion, accept, context); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, String orgName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, context).block(); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner get(String resourceGroupName, String securityConnectorName, String orgName) { - return getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE).getValue(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, context); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, this.client.getContext()); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, azureDevOpsOrg, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, context); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg) - .getSyncPoller(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, - Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) - .getSyncPoller(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).block(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).block(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, context); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginUpdateAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, this.client.getContext()); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginUpdateAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, context); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).getSyncPoller(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) - .getSyncPoller(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).block(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java deleted file mode 100644 index a51d49dabb6eb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AzureDevOpsOrgsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgListResponse; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgs; - -public final class AzureDevOpsOrgsImpl implements AzureDevOpsOrgs { - private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsOrgsImpl.class); - - private final AzureDevOpsOrgsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AzureDevOpsOrgsImpl(AzureDevOpsOrgsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsOrgListResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AzureDevOpsOrgListResponse listAvailable(String resourceGroupName, String securityConnectorName) { - AzureDevOpsOrgListResponseInner inner - = this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); - if (inner != null) { - return new AzureDevOpsOrgListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, orgName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsOrgImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName) { - AzureDevOpsOrgInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName); - if (inner != null) { - return new AzureDevOpsOrgImpl(inner, this.manager()); - } else { - return null; - } - } - - public AzureDevOpsOrg getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, context); - } - - private AzureDevOpsOrgsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AzureDevOpsOrgImpl define(String name) { - return new AzureDevOpsOrgImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java deleted file mode 100644 index ea3919c3f628b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import com.azure.resourcemanager.security.models.AzureDevOpsProject; -import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; - -public final class AzureDevOpsProjectImpl - implements AzureDevOpsProject, AzureDevOpsProject.Definition, AzureDevOpsProject.Update { - private AzureDevOpsProjectInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AzureDevOpsProjectProperties properties() { - return this.innerModel().properties(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureDevOpsProjectInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String orgName; - - private String projectName; - - public AzureDevOpsProjectImpl withExistingAzureDevOpsOrg(String resourceGroupName, String securityConnectorName, - String orgName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - this.orgName = orgName; - return this; - } - - public AzureDevOpsProject create() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), - Context.NONE); - return this; - } - - public AzureDevOpsProject create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context); - return this; - } - - AzureDevOpsProjectImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AzureDevOpsProjectInner(); - this.serviceManager = serviceManager; - this.projectName = name; - } - - public AzureDevOpsProjectImpl update() { - return this; - } - - public AzureDevOpsProject apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), Context.NONE); - return this; - } - - public AzureDevOpsProject apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context); - return this; - } - - AzureDevOpsProjectImpl(AzureDevOpsProjectInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - } - - public AzureDevOpsProject refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE) - .getValue(); - return this; - } - - public AzureDevOpsProject refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context) - .getValue(); - return this; - } - - public AzureDevOpsProjectImpl withProperties(AzureDevOpsProjectProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java deleted file mode 100644 index 9417e3f734e12..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java +++ /dev/null @@ -1,1052 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.AzureDevOpsProjectsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import com.azure.resourcemanager.security.models.AzureDevOpsProjectListResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsProjectsClient. - */ -public final class AzureDevOpsProjectsClientImpl implements AzureDevOpsProjectsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureDevOpsProjectsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AzureDevOpsProjectsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureDevOpsProjectsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AzureDevOpsProjectsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAzureDevOpsProjects to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAzureD") - public interface AzureDevOpsProjectsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - orgName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, context)); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, apiVersion, accept, context); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, context).block(); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName) { - return getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE).getValue(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, context); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, azureDevOpsProject); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, azureDevOpsProject, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, context); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject, context) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) - .block(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, - context).block(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, context); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, azureDevOpsProject); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, - this.client.getContext()); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, azureDevOpsProject, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, context); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, - context) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject).block(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java deleted file mode 100644 index 1979a1eb0764f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AzureDevOpsProjectsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import com.azure.resourcemanager.security.models.AzureDevOpsProject; -import com.azure.resourcemanager.security.models.AzureDevOpsProjects; - -public final class AzureDevOpsProjectsImpl implements AzureDevOpsProjects { - private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsProjectsImpl.class); - - private final AzureDevOpsProjectsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AzureDevOpsProjectsImpl(AzureDevOpsProjectsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsProjectImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsProjectImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsProjectImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AzureDevOpsProject get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName) { - AzureDevOpsProjectInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName, projectName); - if (inner != null) { - return new AzureDevOpsProjectImpl(inner, this.manager()); - } else { - return null; - } - } - - public AzureDevOpsProject getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context); - } - - private AzureDevOpsProjectsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AzureDevOpsProjectImpl define(String name) { - return new AzureDevOpsProjectImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java deleted file mode 100644 index 43bbacc4aed14..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java +++ /dev/null @@ -1,1121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.AzureDevOpsReposClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryListResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsReposClient. - */ -public final class AzureDevOpsReposClientImpl implements AzureDevOpsReposClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureDevOpsReposService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AzureDevOpsReposClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureDevOpsReposClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AzureDevOpsReposService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAzureDevOpsRepos to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAzureD") - public interface AzureDevOpsReposService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - orgName, projectName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, projectName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, projectName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName, context)); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, repoName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, repoName, apiVersion, accept, context); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context) - .block(); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName) { - return getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) - .getValue(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, repoName, apiVersion, - azureDevOpsRepository, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, repoName, apiVersion, azureDevOpsRepository, accept, context); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, context); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).block(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, - Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).block(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, repoName, apiVersion, - azureDevOpsRepository, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, repoName, apiVersion, azureDevOpsRepository, accept, context); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, repoName, azureDevOpsRepository); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, - this.client.getContext()); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, repoName, azureDevOpsRepository, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, context); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, - Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).block(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java deleted file mode 100644 index 06dbf86e5b744..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AzureDevOpsReposClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import com.azure.resourcemanager.security.models.AzureDevOpsRepos; -import com.azure.resourcemanager.security.models.AzureDevOpsRepository; - -public final class AzureDevOpsReposImpl implements AzureDevOpsRepos { - private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsReposImpl.class); - - private final AzureDevOpsReposClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AzureDevOpsReposImpl(AzureDevOpsReposClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsRepositoryImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsRepositoryImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsRepositoryImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AzureDevOpsRepository get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName) { - AzureDevOpsRepositoryInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName, projectName, repoName); - if (inner != null) { - return new AzureDevOpsRepositoryImpl(inner, this.manager()); - } else { - return null; - } - } - - public AzureDevOpsRepository getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String repoName = ResourceManagerUtils.getValueFromIdByName(id, "repos"); - if (repoName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'repos'.", id))); - } - return this - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String repoName = ResourceManagerUtils.getValueFromIdByName(id, "repos"); - if (repoName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'repos'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context); - } - - private AzureDevOpsReposClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AzureDevOpsRepositoryImpl define(String name) { - return new AzureDevOpsRepositoryImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java deleted file mode 100644 index 81f33dc76ad88..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import com.azure.resourcemanager.security.models.AzureDevOpsRepository; -import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; - -public final class AzureDevOpsRepositoryImpl - implements AzureDevOpsRepository, AzureDevOpsRepository.Definition, AzureDevOpsRepository.Update { - private AzureDevOpsRepositoryInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AzureDevOpsRepositoryProperties properties() { - return this.innerModel().properties(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureDevOpsRepositoryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String orgName; - - private String projectName; - - private String repoName; - - public AzureDevOpsRepositoryImpl withExistingProject(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - this.orgName = orgName; - this.projectName = projectName; - return this; - } - - public AzureDevOpsRepository create() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - Context.NONE); - return this; - } - - public AzureDevOpsRepository create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - context); - return this; - } - - AzureDevOpsRepositoryImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AzureDevOpsRepositoryInner(); - this.serviceManager = serviceManager; - this.repoName = name; - } - - public AzureDevOpsRepositoryImpl update() { - return this; - } - - public AzureDevOpsRepository apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .update(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - Context.NONE); - return this; - } - - public AzureDevOpsRepository apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .update(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - context); - return this; - } - - AzureDevOpsRepositoryImpl(AzureDevOpsRepositoryInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.repoName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "repos"); - } - - public AzureDevOpsRepository refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) - .getValue(); - return this; - } - - public AzureDevOpsRepository refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context) - .getValue(); - return this; - } - - public AzureDevOpsRepositoryImpl withProperties(AzureDevOpsRepositoryProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java deleted file mode 100644 index 852c490b819c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.Compliance; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class ComplianceImpl implements Compliance { - private ComplianceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ComplianceImpl(ComplianceInner 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 OffsetDateTime assessmentTimestampUtcDate() { - return this.innerModel().assessmentTimestampUtcDate(); - } - - public Integer resourceCount() { - return this.innerModel().resourceCount(); - } - - public List assessmentResult() { - List inner = this.innerModel().assessmentResult(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ComplianceInner 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/CompliancesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java deleted file mode 100644 index 5bd85496d03ec..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.ComplianceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CompliancesClient. - */ -public final class CompliancesClientImpl implements CompliancesClient { - /** - * The proxy service used to perform REST calls. - */ - private final CompliancesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of CompliancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CompliancesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(CompliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterCompliances to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterCompli") - public interface CompliancesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/compliances") - @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/compliances/{complianceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("complianceName") String complianceName, @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); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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())); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String complianceName) { - 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 (complianceName == null) { - return Mono.error(new IllegalArgumentException("Parameter complianceName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, complianceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String complianceName, 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 (complianceName == null) { - return Mono.error(new IllegalArgumentException("Parameter complianceName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, complianceName, accept, context); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String complianceName) { - return getWithResponseAsync(scope, complianceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String complianceName, Context context) { - return getWithResponseAsync(scope, complianceName, context).block(); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComplianceInner get(String scope, String complianceName) { - return getWithResponse(scope, complianceName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java deleted file mode 100644 index e66593bba785e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.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.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.CompliancesClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.Compliance; -import com.azure.resourcemanager.security.models.Compliances; - -public final class CompliancesImpl implements Compliances { - private static final ClientLogger LOGGER = new ClientLogger(CompliancesImpl.class); - - private final CompliancesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public CompliancesImpl(CompliancesClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); - } - - public Response getWithResponse(String scope, String complianceName, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, complianceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ComplianceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Compliance get(String scope, String complianceName) { - ComplianceInner inner = this.serviceClient().get(scope, complianceName); - if (inner != null) { - return new ComplianceImpl(inner, this.manager()); - } else { - return null; - } - } - - private CompliancesClient 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/ConnectorSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java deleted file mode 100644 index d8e7f49b53cf0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; - -public final class ConnectorSettingImpl - implements ConnectorSetting, ConnectorSetting.Definition, ConnectorSetting.Update { - private ConnectorSettingInner 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 HybridComputeSettingsProperties hybridComputeSettings() { - return this.innerModel().hybridComputeSettings(); - } - - public AuthenticationDetailsProperties authenticationDetails() { - return this.innerModel().authenticationDetails(); - } - - public ConnectorSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String connectorName; - - public ConnectorSetting create() { - this.innerObject = serviceManager.serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ConnectorSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), context) - .getValue(); - return this; - } - - ConnectorSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new ConnectorSettingInner(); - this.serviceManager = serviceManager; - this.connectorName = name; - } - - public ConnectorSettingImpl update() { - return this; - } - - public ConnectorSetting apply() { - this.innerObject = serviceManager.serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ConnectorSetting apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), context) - .getValue(); - return this; - } - - ConnectorSettingImpl(ConnectorSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.connectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectors"); - } - - public ConnectorSetting refresh() { - this.innerObject - = serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, Context.NONE).getValue(); - return this; - } - - public ConnectorSetting refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, context).getValue(); - return this; - } - - public ConnectorSettingImpl withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { - this.innerModel().withHybridComputeSettings(hybridComputeSettings); - return this; - } - - public ConnectorSettingImpl withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { - this.innerModel().withAuthenticationDetails(authenticationDetails); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java deleted file mode 100644 index 53a815f6fc9d4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java +++ /dev/null @@ -1,610 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.ConnectorSettingList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ConnectorsClient. - */ -public final class ConnectorsClientImpl implements ConnectorsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ConnectorsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ConnectorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ConnectorsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterConnectors to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterConnec") - public interface ConnectorsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors") - @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/connectors/{connectorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, - @BodyParam("application/json") ConnectorSettingInner connectorSetting, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("connectorName") String connectorName, - @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); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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())); - } - - /** - * Cloud accounts connectors of a 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 for a subscription, list of all cloud account connectors and their settings along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Cloud accounts connectors of a 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Cloud accounts connectors of a 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String connectorName) { - 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 (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - connectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String connectorName, 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 (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, - accept, context); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String connectorName) { - return getWithResponseAsync(connectorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String connectorName, Context context) { - return getWithResponseAsync(connectorName, context).block(); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectorSettingInner get(String connectorName) { - return getWithResponse(connectorName, Context.NONE).getValue(); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String connectorName, - ConnectorSettingInner connectorSetting) { - 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 (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - if (connectorSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectorSetting is required and cannot be null.")); - } else { - connectorSetting.validate(); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), connectorName, connectorSetting, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String connectorName, - ConnectorSettingInner connectorSetting, 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 (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - if (connectorSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectorSetting is required and cannot be null.")); - } else { - connectorSetting.validate(); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - connectorName, connectorSetting, accept, context); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String connectorName, - ConnectorSettingInner connectorSetting) { - return createOrUpdateWithResponseAsync(connectorName, connectorSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String connectorName, - ConnectorSettingInner connectorSetting, Context context) { - return createOrUpdateWithResponseAsync(connectorName, connectorSetting, context).block(); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectorSettingInner createOrUpdate(String connectorName, ConnectorSettingInner connectorSetting) { - return createOrUpdateWithResponse(connectorName, connectorSetting, Context.NONE).getValue(); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String connectorName) { - 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 (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), connectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String connectorName, 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 (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, - accept, context); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String connectorName) { - return deleteWithResponseAsync(connectorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String connectorName, Context context) { - return deleteWithResponseAsync(connectorName, context).block(); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 connectorName) { - deleteWithResponse(connectorName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java deleted file mode 100644 index b0fc9d20799e1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.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.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.ConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import com.azure.resourcemanager.security.models.Connectors; - -public final class ConnectorsImpl implements Connectors { - private static final ClientLogger LOGGER = new ClientLogger(ConnectorsImpl.class); - - private final ConnectorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ConnectorsImpl(ConnectorsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String connectorName, Context context) { - Response inner = this.serviceClient().getWithResponse(connectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectorSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectorSetting get(String connectorName) { - ConnectorSettingInner inner = this.serviceClient().get(connectorName); - if (inner != null) { - return new ConnectorSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String connectorName, Context context) { - return this.serviceClient().deleteWithResponse(connectorName, context); - } - - public void delete(String connectorName) { - this.serviceClient().delete(connectorName); - } - - public ConnectorSetting getById(String id) { - String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - return this.getWithResponse(connectorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - return this.getWithResponse(connectorName, context); - } - - public void deleteById(String id) { - String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - this.deleteWithResponse(connectorName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - return this.deleteWithResponse(connectorName, context); - } - - private ConnectorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public ConnectorSettingImpl define(String name) { - return new ConnectorSettingImpl(name, this.manager()); - } -} 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 deleted file mode 100644 index 0b3887a29ac01..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (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 deleted file mode 100644 index bcf9d01be2f24..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java +++ /dev/null @@ -1,966 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.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 { - /** - * 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") - public 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 custom assessment automation - * - * 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 along with - * {@link Response} on successful completion of {@link Mono}. - */ - @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 custom assessment automation - * - * 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 along with - * {@link Response} on successful completion of {@link Mono}. - */ - @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 custom assessment automation - * - * 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 on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, - String customAssessmentAutomationName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a custom assessment automation - * - * 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 along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String customAssessmentAutomationName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); - } - - /** - * Gets a custom assessment automation - * - * 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 getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) - .getValue(); - } - - /** - * Creates a custom assessment automation - * - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 a custom assessment automation - * - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 a custom assessment automation - * - * 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, - String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody) { - return createWithResponseAsync(resourceGroupName, customAssessmentAutomationName, - customAssessmentAutomationBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a custom assessment automation - * - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody, - Context context) { - return createWithResponseAsync(resourceGroupName, customAssessmentAutomationName, - customAssessmentAutomationBody, context).block(); - } - - /** - * Creates a custom assessment automation - * - * 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 createWithResponse(resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, - Context.NONE).getValue(); - } - - /** - * Deletes a custom assessment automation - * - * 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 {@link Response} on successful completion of {@link Mono}. - */ - @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 - * - * 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 {@link Response} on successful completion of {@link Mono}. - */ - @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 - * - * 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String customAssessmentAutomationName) { - return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a custom assessment automation - * - * 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); - } - - /** - * Deletes a custom assessment automation - * - * 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) { - deleteWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 in a subscription and a resource group - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 in a subscription and a resource group - * - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 as paginated response with {@link PagedFlux}. - */ - @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 in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List custom assessment automations in a subscription - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-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 in a subscription - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-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 in a subscription - * - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java deleted file mode 100644 index 0ccaf3e238622..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (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; - -public final class CustomAssessmentAutomationsImpl implements CustomAssessmentAutomations { - private static 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 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 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 deleteByResourceGroupWithResponse(String resourceGroupName, - String customAssessmentAutomationName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String customAssessmentAutomationName) { - this.serviceClient().delete(resourceGroupName, customAssessmentAutomationName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); - } - - public CustomAssessmentAutomation getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customAssessmentAutomationName - = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customAssessmentAutomationName - = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customAssessmentAutomationName - = ResourceManagerUtils.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.deleteByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customAssessmentAutomationName - = ResourceManagerUtils.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.deleteByResourceGroupWithResponse(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 deleted file mode 100644 index f2249d1a838a3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 deleted file mode 100644 index 04ab482cf3adb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java +++ /dev/null @@ -1,963 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.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 { - /** - * 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") - public 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 custom entity store assignment - * - * 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 along - * with {@link Response} on successful completion of {@link Mono}. - */ - @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 custom entity store assignment - * - * 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 along - * with {@link Response} on successful completion of {@link Mono}. - */ - @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 custom entity store assignment - * - * 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 on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, - String customEntityStoreAssignmentName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a custom entity store assignment - * - * 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 along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String customEntityStoreAssignmentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); - } - - /** - * Gets a custom entity store assignment - * - * 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 getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) - .getValue(); - } - - /** - * Creates a custom entity store assignment - * - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 - * - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 - * - * 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { - return createWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a custom entity store assignment - * - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, Context context) { - return createWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, context).block(); - } - - /** - * Creates a custom entity store assignment - * - * 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 createWithResponse(resourceGroupName, customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, Context.NONE).getValue(); - } - - /** - * Deleted a custom entity store assignment - * - * 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 {@link Response} on successful completion of {@link Mono}. - */ - @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())); - } - - /** - * Deleted a custom entity store assignment - * - * 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 {@link Response} on successful completion of {@link Mono}. - */ - @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); - } - - /** - * Deleted a custom entity store assignment - * - * 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String customEntityStoreAssignmentName) { - return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deleted a custom entity store assignment - * - * 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); - } - - /** - * Deleted a custom entity store assignment - * - * 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) { - deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 in a subscription and a resource group - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 in a subscription and a resource group - * - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 as paginated response with {@link PagedFlux}. - */ - @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 in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List custom entity store assignments in a subscription - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-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 in a subscription - * - * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-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 in a subscription - * - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java deleted file mode 100644 index 5ac206c8eea7b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (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; - -public final class CustomEntityStoreAssignmentsImpl implements CustomEntityStoreAssignments { - private static 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 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 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 deleteByResourceGroupWithResponse(String resourceGroupName, - String customEntityStoreAssignmentName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName) { - this.serviceClient().delete(resourceGroupName, customEntityStoreAssignmentName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public CustomEntityStoreAssignment getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName - = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName - = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName - = ResourceManagerUtils.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.deleteByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName - = ResourceManagerUtils.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.deleteByResourceGroupWithResponse(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/DefenderForStorageSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java deleted file mode 100644 index b62ddb109c7a6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.models.DefenderForStorageSetting; -import com.azure.resourcemanager.security.models.DefenderForStorageSettingProperties; -import com.azure.resourcemanager.security.models.MalwareScan; -import com.azure.resourcemanager.security.models.SettingName; - -public final class DefenderForStorageSettingImpl - implements DefenderForStorageSetting, DefenderForStorageSetting.Definition { - private DefenderForStorageSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DefenderForStorageSettingImpl(DefenderForStorageSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public DefenderForStorageSettingProperties properties() { - return this.innerModel().properties(); - } - - public DefenderForStorageSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private SettingName settingName; - - public DefenderForStorageSettingImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public DefenderForStorageSetting create() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .createWithResponse(resourceId, settingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public DefenderForStorageSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .createWithResponse(resourceId, settingName, this.innerModel(), context) - .getValue(); - return this; - } - - DefenderForStorageSettingImpl(SettingName name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new DefenderForStorageSettingInner(); - this.serviceManager = serviceManager; - this.settingName = name; - } - - public DefenderForStorageSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .getWithResponse(resourceId, settingName, Context.NONE) - .getValue(); - return this; - } - - public DefenderForStorageSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .getWithResponse(resourceId, settingName, context) - .getValue(); - return this; - } - - public Response startMalwareScanWithResponse(Context context) { - return serviceManager.defenderForStorages().startMalwareScanWithResponse(resourceId, settingName, context); - } - - public MalwareScan startMalwareScan() { - return serviceManager.defenderForStorages().startMalwareScan(resourceId, settingName); - } - - public DefenderForStorageSettingImpl withProperties(DefenderForStorageSettingProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java deleted file mode 100644 index 4fa38711b4106..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java +++ /dev/null @@ -1,713 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.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.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.SettingName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DefenderForStoragesClient. - */ -public final class DefenderForStoragesClientImpl implements DefenderForStoragesClient { - /** - * The proxy service used to perform REST calls. - */ - private final DefenderForStoragesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DefenderForStoragesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DefenderForStoragesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DefenderForStoragesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDefenderForStorages to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDefend") - public interface DefenderForStoragesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, - @BodyParam("application/json") DefenderForStorageSettingInner defenderForStorageSetting, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/startMalwareScan") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> startMalwareScan(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/malwareScans/{scanId}/cancelMalwareScan") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelMalwareScan(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @PathParam("scanId") String scanId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/malwareScans/{scanId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMalwareScan(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @PathParam("scanId") String scanId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - SettingName settingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - SettingName settingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, SettingName settingName) { - return getWithResponseAsync(resourceId, settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, SettingName settingName, - Context context) { - return getWithResponseAsync(resourceId, settingName, context).block(); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForStorageSettingInner get(String resourceId, SettingName settingName) { - return getWithResponse(resourceId, settingName, Context.NONE).getValue(); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - SettingName settingName, DefenderForStorageSettingInner defenderForStorageSetting) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (defenderForStorageSetting == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForStorageSetting is required and cannot be null.")); - } else { - defenderForStorageSetting.validate(); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, - defenderForStorageSetting, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - SettingName settingName, DefenderForStorageSettingInner defenderForStorageSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (defenderForStorageSetting == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForStorageSetting is required and cannot be null.")); - } else { - defenderForStorageSetting.validate(); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, defenderForStorageSetting, - accept, context); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting) { - return createWithResponseAsync(resourceId, settingName, defenderForStorageSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting, Context context) { - return createWithResponseAsync(resourceId, settingName, defenderForStorageSetting, context).block(); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForStorageSettingInner create(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting) { - return createWithResponse(resourceId, settingName, defenderForStorageSetting, Context.NONE).getValue(); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startMalwareScanWithResponseAsync(String resourceId, - SettingName settingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.startMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, - settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startMalwareScanWithResponseAsync(String resourceId, - SettingName settingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.startMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, - context); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startMalwareScanAsync(String resourceId, SettingName settingName) { - return startMalwareScanWithResponseAsync(resourceId, settingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startMalwareScanWithResponse(String resourceId, SettingName settingName, - Context context) { - return startMalwareScanWithResponseAsync(resourceId, settingName, context).block(); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MalwareScanInner startMalwareScan(String resourceId, SettingName settingName) { - return startMalwareScanWithResponse(resourceId, settingName, Context.NONE).getValue(); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelMalwareScanWithResponseAsync(String resourceId, - SettingName settingName, String scanId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cancelMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, - settingName, scanId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelMalwareScanWithResponseAsync(String resourceId, - SettingName settingName, String scanId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, settingName, scanId, accept, - context); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelMalwareScanAsync(String resourceId, SettingName settingName, String scanId) { - return cancelMalwareScanWithResponseAsync(resourceId, settingName, scanId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, - String scanId, Context context) { - return cancelMalwareScanWithResponseAsync(resourceId, settingName, scanId, context).block(); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MalwareScanInner cancelMalwareScan(String resourceId, SettingName settingName, String scanId) { - return cancelMalwareScanWithResponse(resourceId, settingName, scanId, Context.NONE).getValue(); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMalwareScanWithResponseAsync(String resourceId, SettingName settingName, - String scanId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, - settingName, scanId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMalwareScanWithResponseAsync(String resourceId, SettingName settingName, - String scanId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, settingName, scanId, accept, - context); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getMalwareScanAsync(String resourceId, SettingName settingName, String scanId) { - return getMalwareScanWithResponseAsync(resourceId, settingName, scanId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMalwareScanWithResponse(String resourceId, SettingName settingName, - String scanId, Context context) { - return getMalwareScanWithResponseAsync(resourceId, settingName, scanId, context).block(); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MalwareScanInner getMalwareScan(String resourceId, SettingName settingName, String scanId) { - return getMalwareScanWithResponse(resourceId, settingName, scanId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java deleted file mode 100644 index 442711129edbe..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.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.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.DefenderForStorageSetting; -import com.azure.resourcemanager.security.models.DefenderForStorages; -import com.azure.resourcemanager.security.models.MalwareScan; -import com.azure.resourcemanager.security.models.SettingName; - -public final class DefenderForStoragesImpl implements DefenderForStorages { - private static final ClientLogger LOGGER = new ClientLogger(DefenderForStoragesImpl.class); - - private final DefenderForStoragesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DefenderForStoragesImpl(DefenderForStoragesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, SettingName settingName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, settingName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DefenderForStorageSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DefenderForStorageSetting get(String resourceId, SettingName settingName) { - DefenderForStorageSettingInner inner = this.serviceClient().get(resourceId, settingName); - if (inner != null) { - return new DefenderForStorageSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response startMalwareScanWithResponse(String resourceId, SettingName settingName, - Context context) { - Response inner - = this.serviceClient().startMalwareScanWithResponse(resourceId, settingName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MalwareScanImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MalwareScan startMalwareScan(String resourceId, SettingName settingName) { - MalwareScanInner inner = this.serviceClient().startMalwareScan(resourceId, settingName); - if (inner != null) { - return new MalwareScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, - String scanId, Context context) { - Response inner - = this.serviceClient().cancelMalwareScanWithResponse(resourceId, settingName, scanId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MalwareScanImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MalwareScan cancelMalwareScan(String resourceId, SettingName settingName, String scanId) { - MalwareScanInner inner = this.serviceClient().cancelMalwareScan(resourceId, settingName, scanId); - if (inner != null) { - return new MalwareScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context) { - Response inner - = this.serviceClient().getMalwareScanWithResponse(resourceId, settingName, scanId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MalwareScanImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MalwareScan getMalwareScan(String resourceId, SettingName settingName, String scanId) { - MalwareScanInner inner = this.serviceClient().getMalwareScan(resourceId, settingName, scanId); - if (inner != null) { - return new MalwareScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public DefenderForStorageSetting getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String settingNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "settingName"); - if (settingNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'defenderForStorageSettings'.", id))); - } - SettingName settingName = SettingName.fromString(settingNameLocal); - return this.getWithResponse(resourceId, settingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String settingNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "settingName"); - if (settingNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'defenderForStorageSettings'.", id))); - } - SettingName settingName = SettingName.fromString(settingNameLocal); - return this.getWithResponse(resourceId, settingName, context); - } - - private DefenderForStoragesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public DefenderForStorageSettingImpl define(SettingName name) { - return new DefenderForStorageSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java deleted file mode 100644 index 9e56179ffc970..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.DevOpsConfiguration; -import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; - -public final class DevOpsConfigurationImpl implements DevOpsConfiguration { - private DevOpsConfigurationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DevOpsConfigurationImpl(DevOpsConfigurationInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public DevOpsConfigurationProperties properties() { - return this.innerModel().properties(); - } - - public DevOpsConfigurationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java deleted file mode 100644 index 7a4687319612c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java +++ /dev/null @@ -1,1148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.DevOpsConfigurationsClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.DevOpsConfigurationListResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DevOpsConfigurationsClient. - */ -public final class DevOpsConfigurationsClientImpl implements DevOpsConfigurationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DevOpsConfigurationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevOpsConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevOpsConfigurationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevOpsConfigurationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevOpsConfigurations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevOps") - public interface DevOpsConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, accept, context); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner get(String resourceGroupName, String securityConnectorName) { - return getWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, devOpsConfiguration, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, devOpsConfiguration, accept, context); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, context); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration) - .getSyncPoller(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) - .getSyncPoller(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).block(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).block(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, devOpsConfiguration, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, devOpsConfiguration, accept, context); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, - this.client.getContext()); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, context); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).getSyncPoller(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) - .getSyncPoller(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return updateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).block(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).block(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, accept, context); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String securityConnectorName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, securityConnectorName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String securityConnectorName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, securityConnectorName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName) { - return this.beginDeleteAsync(resourceGroupName, securityConnectorName).getSyncPoller(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, securityConnectorName, context).getSyncPoller(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { - return beginDeleteAsync(resourceGroupName, securityConnectorName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, Context context) { - return beginDeleteAsync(resourceGroupName, securityConnectorName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName) { - deleteAsync(resourceGroupName, securityConnectorName).block(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName, Context context) { - deleteAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java deleted file mode 100644 index 60c918ba97bdb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevOpsConfigurationsClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.DevOpsConfiguration; -import com.azure.resourcemanager.security.models.DevOpsConfigurations; - -public final class DevOpsConfigurationsImpl implements DevOpsConfigurations { - private static final ClientLogger LOGGER = new ClientLogger(DevOpsConfigurationsImpl.class); - - private final DevOpsConfigurationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevOpsConfigurationsImpl(DevOpsConfigurationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsConfigurationImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DevOpsConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DevOpsConfiguration get(String resourceGroupName, String securityConnectorName) { - DevOpsConfigurationInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - DevOpsConfigurationInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, devOpsConfiguration); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - DevOpsConfigurationInner inner = this.serviceClient() - .createOrUpdate(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - DevOpsConfigurationInner inner - = this.serviceClient().update(resourceGroupName, securityConnectorName, devOpsConfiguration); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - DevOpsConfigurationInner inner - = this.serviceClient().update(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { - this.serviceClient().delete(resourceGroupName, securityConnectorName); - } - - public void delete(String resourceGroupName, String securityConnectorName, Context context) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, context); - } - - private DevOpsConfigurationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java deleted file mode 100644 index 37a673528a2ef..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DevOpsOperationResultsClient; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DevOpsOperationResultsClient. - */ -public final class DevOpsOperationResultsClientImpl implements DevOpsOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DevOpsOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevOpsOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevOpsOperationResultsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevOpsOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevOpsOperationResults to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevOps") - public interface DevOpsOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/operationResults/{operationResultId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("operationResultId") String operationResultId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String operationResultId) { - 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 (operationResultId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, operationResultId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String operationResultId, 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 (operationResultId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, operationResultId, apiVersion, accept, context); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String operationResultId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, operationResultId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, operationResultId, context).block(); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner get(String resourceGroupName, String securityConnectorName, - String operationResultId) { - return getWithResponse(resourceGroupName, securityConnectorName, operationResultId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java deleted file mode 100644 index 70ec0c19e8a93..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.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.DevOpsOperationResultsClient; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.security.models.DevOpsOperationResults; -import com.azure.resourcemanager.security.models.OperationStatusResult; - -public final class DevOpsOperationResultsImpl implements DevOpsOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(DevOpsOperationResultsImpl.class); - - private final DevOpsOperationResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevOpsOperationResultsImpl(DevOpsOperationResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, operationResultId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationStatusResult get(String resourceGroupName, String securityConnectorName, String operationResultId) { - OperationStatusResultInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, operationResultId); - if (inner != null) { - return new OperationStatusResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private DevOpsOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPoliciesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPoliciesClientImpl.java deleted file mode 100644 index 08d346c5cdd6c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPoliciesClientImpl.java +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DevOpsPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyInner; -import com.azure.resourcemanager.security.models.DevOpsPolicyListResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DevOpsPoliciesClient. - */ -public final class DevOpsPoliciesClientImpl implements DevOpsPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final DevOpsPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevOpsPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevOpsPoliciesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(DevOpsPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevOpsPolicies to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevOps") - public interface DevOpsPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("devOpsPolicyType") String devOpsPolicyType, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policies/{policyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("policyName") String policyName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String devOpsPolicyType) { - 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 = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, devOpsPolicyType, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String devOpsPolicyType, 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 = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - devOpsPolicyType, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, devOpsPolicyType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - final String devOpsPolicyType = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, devOpsPolicyType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - final String devOpsPolicyType = null; - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, devOpsPolicyType)); - } - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, context)); - } - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyName) { - 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 (policyName == null) { - return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, policyName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyName, 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 (policyName == null) { - return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, policyName, apiVersion, accept, context); - } - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String policyName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, policyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, policyName, context).block(); - } - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsPolicyInner get(String resourceGroupName, String securityConnectorName, String policyName) { - return getWithResponse(resourceGroupName, securityConnectorName, policyName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPoliciesImpl.java deleted file mode 100644 index 0d738cb1b82bb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPoliciesImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.DevOpsPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyInner; -import com.azure.resourcemanager.security.models.DevOpsPolicies; -import com.azure.resourcemanager.security.models.DevOpsPolicy; - -public final class DevOpsPoliciesImpl implements DevOpsPolicies { - private static final ClientLogger LOGGER = new ClientLogger(DevOpsPoliciesImpl.class); - - private final DevOpsPoliciesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevOpsPoliciesImpl(DevOpsPoliciesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, devOpsPolicyType, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsPolicyImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, policyName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DevOpsPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DevOpsPolicy get(String resourceGroupName, String securityConnectorName, String policyName) { - DevOpsPolicyInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, policyName); - if (inner != null) { - return new DevOpsPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - private DevOpsPoliciesClient 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/DevOpsPolicyAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentImpl.java deleted file mode 100644 index dae8ae169b171..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (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.DevOpsPolicyAssignmentInner; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignment; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignmentProperties; - -public final class DevOpsPolicyAssignmentImpl - implements DevOpsPolicyAssignment, DevOpsPolicyAssignment.Definition, DevOpsPolicyAssignment.Update { - private DevOpsPolicyAssignmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public DevOpsPolicyAssignmentProperties properties() { - return this.innerModel().properties(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public DevOpsPolicyAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String policyAssignmentId; - - public DevOpsPolicyAssignmentImpl withExistingSecurityConnector(String resourceGroupName, - String securityConnectorName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - return this; - } - - public DevOpsPolicyAssignment create() { - this.innerObject = serviceManager.serviceClient() - .getDevOpsPolicyAssignments() - .createOrUpdate(resourceGroupName, securityConnectorName, policyAssignmentId, this.innerModel(), - Context.NONE); - return this; - } - - public DevOpsPolicyAssignment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDevOpsPolicyAssignments() - .createOrUpdate(resourceGroupName, securityConnectorName, policyAssignmentId, this.innerModel(), context); - return this; - } - - DevOpsPolicyAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new DevOpsPolicyAssignmentInner(); - this.serviceManager = serviceManager; - this.policyAssignmentId = name; - } - - public DevOpsPolicyAssignmentImpl update() { - return this; - } - - public DevOpsPolicyAssignment apply() { - this.innerObject = serviceManager.serviceClient() - .getDevOpsPolicyAssignments() - .update(resourceGroupName, securityConnectorName, policyAssignmentId, this.innerModel(), Context.NONE); - return this; - } - - public DevOpsPolicyAssignment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDevOpsPolicyAssignments() - .update(resourceGroupName, securityConnectorName, policyAssignmentId, this.innerModel(), context); - return this; - } - - DevOpsPolicyAssignmentImpl(DevOpsPolicyAssignmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.policyAssignmentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "policyAssignments"); - } - - public DevOpsPolicyAssignment refresh() { - this.innerObject = serviceManager.serviceClient() - .getDevOpsPolicyAssignments() - .getWithResponse(resourceGroupName, securityConnectorName, policyAssignmentId, Context.NONE) - .getValue(); - return this; - } - - public DevOpsPolicyAssignment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDevOpsPolicyAssignments() - .getWithResponse(resourceGroupName, securityConnectorName, policyAssignmentId, context) - .getValue(); - return this; - } - - public DevOpsPolicyAssignmentImpl withProperties(DevOpsPolicyAssignmentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentsClientImpl.java deleted file mode 100644 index 52cf58bb8f83d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentsClientImpl.java +++ /dev/null @@ -1,1284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.DevOpsPolicyAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyAssignmentInner; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignmentListResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DevOpsPolicyAssignmentsClient. - */ -public final class DevOpsPolicyAssignmentsClientImpl implements DevOpsPolicyAssignmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DevOpsPolicyAssignmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevOpsPolicyAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevOpsPolicyAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevOpsPolicyAssignmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevOpsPolicyAssignments to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevOps") - public interface DevOpsPolicyAssignmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policyAssignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("devOpsPolicyType") String devOpsPolicyType, @QueryParam("resourceId") String resourceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policyAssignments/{policyAssignmentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("policyAssignmentId") String policyAssignmentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policyAssignments/{policyAssignmentId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("policyAssignmentId") String policyAssignmentId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DevOpsPolicyAssignmentInner devOpsPolicyAssignment, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policyAssignments/{policyAssignmentId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("policyAssignmentId") String policyAssignmentId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DevOpsPolicyAssignmentInner devOpsPolicyAssignment, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policyAssignments/{policyAssignmentId}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("policyAssignmentId") String policyAssignmentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String devOpsPolicyType, String resourceId) { - 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 = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String devOpsPolicyType, String resourceId, 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 = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - devOpsPolicyType, resourceId, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, String resourceId) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - final String devOpsPolicyType = null; - final String resourceId = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, String resourceId, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - final String devOpsPolicyType = null; - final String resourceId = null; - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId)); - } - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, String resourceId, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId, context)); - } - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId) { - 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, policyAssignmentId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, policyAssignmentId, apiVersion, accept, context); - } - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String policyAssignmentId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, policyAssignmentId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, policyAssignmentId, context).block(); - } - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsPolicyAssignmentInner get(String resourceGroupName, String securityConnectorName, - String policyAssignmentId) { - return getWithResponse(resourceGroupName, securityConnectorName, policyAssignmentId, Context.NONE).getValue(); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (devOpsPolicyAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter devOpsPolicyAssignment is required and cannot be null.")); - } else { - devOpsPolicyAssignment.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, policyAssignmentId, apiVersion, devOpsPolicyAssignment, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, - 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (devOpsPolicyAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter devOpsPolicyAssignment is required and cannot be null.")); - } else { - devOpsPolicyAssignment.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, policyAssignmentId, apiVersion, devOpsPolicyAssignment, accept, context); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsPolicyAssignmentInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, policyAssignmentId, devOpsPolicyAssignment); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsPolicyAssignmentInner.class, DevOpsPolicyAssignmentInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsPolicyAssignmentInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, policyAssignmentId, devOpsPolicyAssignment, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsPolicyAssignmentInner.class, DevOpsPolicyAssignmentInner.class, - context); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsPolicyAssignmentInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, - devOpsPolicyAssignment) - .getSyncPoller(); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsPolicyAssignmentInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, - devOpsPolicyAssignment, context) - .getSyncPoller(); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, - devOpsPolicyAssignment).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, - devOpsPolicyAssignment, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsPolicyAssignmentInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment) - .block(); - } - - /** - * Creates or updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsPolicyAssignmentInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment, - context).block(); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (devOpsPolicyAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter devOpsPolicyAssignment is required and cannot be null.")); - } else { - devOpsPolicyAssignment.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, policyAssignmentId, apiVersion, devOpsPolicyAssignment, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, - 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (devOpsPolicyAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter devOpsPolicyAssignment is required and cannot be null.")); - } else { - devOpsPolicyAssignment.validate(); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, policyAssignmentId, apiVersion, devOpsPolicyAssignment, accept, context); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsPolicyAssignmentInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - policyAssignmentId, devOpsPolicyAssignment); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsPolicyAssignmentInner.class, DevOpsPolicyAssignmentInner.class, - this.client.getContext()); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsPolicyAssignmentInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - policyAssignmentId, devOpsPolicyAssignment, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsPolicyAssignmentInner.class, DevOpsPolicyAssignmentInner.class, - context); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsPolicyAssignmentInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment) - .getSyncPoller(); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsPolicyAssignmentInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String policyAssignmentId, - DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment, - context) - .getSyncPoller(); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsPolicyAssignmentInner update(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment) { - return updateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment) - .block(); - } - - /** - * Updates a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param devOpsPolicyAssignment The DevOps Policy Assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsPolicyAssignmentInner update(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, DevOpsPolicyAssignmentInner devOpsPolicyAssignment, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, policyAssignmentId, devOpsPolicyAssignment, - context).block(); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId) { - 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, policyAssignmentId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String securityConnectorName, String policyAssignmentId, 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 (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, policyAssignmentId, apiVersion, accept, context); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String securityConnectorName, - String policyAssignmentId) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, securityConnectorName, policyAssignmentId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, securityConnectorName, policyAssignmentId, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - String policyAssignmentId) { - return this.beginDeleteAsync(resourceGroupName, securityConnectorName, policyAssignmentId).getSyncPoller(); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context) { - return this.beginDeleteAsync(resourceGroupName, securityConnectorName, policyAssignmentId, context) - .getSyncPoller(); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, String policyAssignmentId) { - return beginDeleteAsync(resourceGroupName, securityConnectorName, policyAssignmentId).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, String policyAssignmentId, - Context context) { - return beginDeleteAsync(resourceGroupName, securityConnectorName, policyAssignmentId, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId) { - deleteAsync(resourceGroupName, securityConnectorName, policyAssignmentId).block(); - } - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId, - Context context) { - deleteAsync(resourceGroupName, securityConnectorName, policyAssignmentId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentsImpl.java deleted file mode 100644 index 6734f58dfdd64..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyAssignmentsImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (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.DevOpsPolicyAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyAssignmentInner; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignment; -import com.azure.resourcemanager.security.models.DevOpsPolicyAssignments; - -public final class DevOpsPolicyAssignmentsImpl implements DevOpsPolicyAssignments { - private static final ClientLogger LOGGER = new ClientLogger(DevOpsPolicyAssignmentsImpl.class); - - private final DevOpsPolicyAssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevOpsPolicyAssignmentsImpl(DevOpsPolicyAssignmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsPolicyAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, String resourceId, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, securityConnectorName, devOpsPolicyType, resourceId, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsPolicyAssignmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, policyAssignmentId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DevOpsPolicyAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DevOpsPolicyAssignment get(String resourceGroupName, String securityConnectorName, - String policyAssignmentId) { - DevOpsPolicyAssignmentInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, policyAssignmentId); - if (inner != null) { - return new DevOpsPolicyAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, policyAssignmentId); - } - - public void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId, - Context context) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, policyAssignmentId, context); - } - - public DevOpsPolicyAssignment getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String policyAssignmentId = ResourceManagerUtils.getValueFromIdByName(id, "policyAssignments"); - if (policyAssignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'policyAssignments'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, policyAssignmentId, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String policyAssignmentId = ResourceManagerUtils.getValueFromIdByName(id, "policyAssignments"); - if (policyAssignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'policyAssignments'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, policyAssignmentId, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String policyAssignmentId = ResourceManagerUtils.getValueFromIdByName(id, "policyAssignments"); - if (policyAssignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'policyAssignments'.", id))); - } - this.delete(resourceGroupName, securityConnectorName, policyAssignmentId, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String policyAssignmentId = ResourceManagerUtils.getValueFromIdByName(id, "policyAssignments"); - if (policyAssignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'policyAssignments'.", id))); - } - this.delete(resourceGroupName, securityConnectorName, policyAssignmentId, context); - } - - private DevOpsPolicyAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public DevOpsPolicyAssignmentImpl define(String name) { - return new DevOpsPolicyAssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyImpl.java deleted file mode 100644 index bacd17f722a7d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsPolicyImpl.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.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyInner; -import com.azure.resourcemanager.security.models.DevOpsPolicy; -import com.azure.resourcemanager.security.models.DevOpsPolicyProperties; - -public final class DevOpsPolicyImpl implements DevOpsPolicy { - private DevOpsPolicyInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DevOpsPolicyImpl(DevOpsPolicyInner 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 DevOpsPolicyProperties properties() { - return this.innerModel().properties(); - } - - public DevOpsPolicyInner 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/GetSensitivitySettingsListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java deleted file mode 100644 index 2536c4907c065..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class GetSensitivitySettingsListResponseImpl implements GetSensitivitySettingsListResponse { - private GetSensitivitySettingsListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GetSensitivitySettingsListResponseImpl(GetSensitivitySettingsListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new GetSensitivitySettingsResponseImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public GetSensitivitySettingsListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java deleted file mode 100644 index 15134d6c65c67..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; - -public final class GetSensitivitySettingsResponseImpl implements GetSensitivitySettingsResponse { - private GetSensitivitySettingsResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GetSensitivitySettingsResponseImpl(GetSensitivitySettingsResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GetSensitivitySettingsResponseProperties properties() { - return this.innerModel().properties(); - } - - public GetSensitivitySettingsResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java deleted file mode 100644 index c8983ce0b00d9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.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.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.models.GitHubOwner; -import com.azure.resourcemanager.security.models.GitHubOwnerProperties; - -public final class GitHubOwnerImpl implements GitHubOwner { - private GitHubOwnerInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitHubOwnerImpl(GitHubOwnerInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitHubOwnerProperties properties() { - return this.innerModel().properties(); - } - - public GitHubOwnerInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java deleted file mode 100644 index 6d727c5be2593..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.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.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; -import com.azure.resourcemanager.security.models.GitHubOwner; -import com.azure.resourcemanager.security.models.GitHubOwnerListResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class GitHubOwnerListResponseImpl implements GitHubOwnerListResponse { - private GitHubOwnerListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitHubOwnerListResponseImpl(GitHubOwnerListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new GitHubOwnerImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public GitHubOwnerListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java deleted file mode 100644 index f1df44dc5cf8b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java +++ /dev/null @@ -1,562 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitHubOwnersClient. - */ -public final class GitHubOwnersClientImpl implements GitHubOwnersClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitHubOwnersService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitHubOwnersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitHubOwnersClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitHubOwnersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitHubOwners to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGitHub") - public interface GitHubOwnersService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitHubOwners") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, accept, context); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableAsync(String resourceGroupName, - String securityConnectorName) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitHubOwnerListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { - return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, ownerName, apiVersion, accept, context); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, String ownerName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, context).block(); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Owner resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName) { - return getWithResponse(resourceGroupName, securityConnectorName, ownerName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java deleted file mode 100644 index 8408b8f3bfec7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; -import com.azure.resourcemanager.security.models.GitHubOwner; -import com.azure.resourcemanager.security.models.GitHubOwnerListResponse; -import com.azure.resourcemanager.security.models.GitHubOwners; - -public final class GitHubOwnersImpl implements GitHubOwners { - private static final ClientLogger LOGGER = new ClientLogger(GitHubOwnersImpl.class); - - private final GitHubOwnersClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitHubOwnersImpl(GitHubOwnersClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitHubOwnerListResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitHubOwnerListResponse listAvailable(String resourceGroupName, String securityConnectorName) { - GitHubOwnerListResponseInner inner - = this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); - if (inner != null) { - return new GitHubOwnerListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubOwnerImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubOwnerImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, ownerName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitHubOwnerImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitHubOwner get(String resourceGroupName, String securityConnectorName, String ownerName) { - GitHubOwnerInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, ownerName); - if (inner != null) { - return new GitHubOwnerImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitHubOwnersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java deleted file mode 100644 index fdb4c1bf7dfa7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitHubReposClient; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import com.azure.resourcemanager.security.models.GitHubRepositoryListResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitHubReposClient. - */ -public final class GitHubReposClientImpl implements GitHubReposClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitHubReposService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitHubReposClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitHubReposClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitHubReposService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitHubRepos to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGitHub") - public interface GitHubReposService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos/{repoName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @PathParam("repoName") String repoName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String ownerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String ownerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - ownerName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String ownerName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, ownerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, ownerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName, context)); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, String repoName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, repoName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, String repoName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, ownerName, repoName, apiVersion, accept, context); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, repoName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, repoName, context).block(); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The GitHub owner name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitHub Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitHubRepositoryInner get(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName) { - return getWithResponse(resourceGroupName, securityConnectorName, ownerName, repoName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java deleted file mode 100644 index 337d99f2269b9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitHubReposClient; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import com.azure.resourcemanager.security.models.GitHubRepos; -import com.azure.resourcemanager.security.models.GitHubRepository; - -public final class GitHubReposImpl implements GitHubRepos { - private static final ClientLogger LOGGER = new ClientLogger(GitHubReposImpl.class); - - private final GitHubReposClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitHubReposImpl(GitHubReposClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, ownerName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubRepositoryImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, ownerName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubRepositoryImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, ownerName, repoName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitHubRepositoryImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitHubRepository get(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName) { - GitHubRepositoryInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, ownerName, repoName); - if (inner != null) { - return new GitHubRepositoryImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitHubReposClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java deleted file mode 100644 index 7a7ea6f4781e8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import com.azure.resourcemanager.security.models.GitHubRepository; -import com.azure.resourcemanager.security.models.GitHubRepositoryProperties; - -public final class GitHubRepositoryImpl implements GitHubRepository { - private GitHubRepositoryInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitHubRepositoryImpl(GitHubRepositoryInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitHubRepositoryProperties properties() { - return this.innerModel().properties(); - } - - public GitHubRepositoryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java deleted file mode 100644 index 76325ed4607fa..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.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.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.models.GitLabGroup; -import com.azure.resourcemanager.security.models.GitLabGroupProperties; - -public final class GitLabGroupImpl implements GitLabGroup { - private GitLabGroupInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitLabGroupImpl(GitLabGroupInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitLabGroupProperties properties() { - return this.innerModel().properties(); - } - - public GitLabGroupInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java deleted file mode 100644 index a5174724475eb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.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.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import com.azure.resourcemanager.security.models.GitLabGroup; -import com.azure.resourcemanager.security.models.GitLabGroupListResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class GitLabGroupListResponseImpl implements GitLabGroupListResponse { - private GitLabGroupListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitLabGroupListResponseImpl(GitLabGroupListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new GitLabGroupImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public GitLabGroupListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java deleted file mode 100644 index 604c2842276bf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitLabGroupsClient. - */ -public final class GitLabGroupsClientImpl implements GitLabGroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitLabGroupsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitLabGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitLabGroupsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitLabGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitLabGroups to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGitLab") - public interface GitLabGroupsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitLabGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, apiVersion, accept, context); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableAsync(String resourceGroupName, - String securityConnectorName) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabGroupListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { - return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, apiVersion, accept, context); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, context).block(); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName) { - return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java deleted file mode 100644 index d1480ba8ad7da..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import com.azure.resourcemanager.security.models.GitLabGroup; -import com.azure.resourcemanager.security.models.GitLabGroupListResponse; -import com.azure.resourcemanager.security.models.GitLabGroups; - -public final class GitLabGroupsImpl implements GitLabGroups { - private static final ClientLogger LOGGER = new ClientLogger(GitLabGroupsImpl.class); - - private final GitLabGroupsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitLabGroupsImpl(GitLabGroupsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitLabGroupListResponse listAvailable(String resourceGroupName, String securityConnectorName) { - GitLabGroupListResponseInner inner - = this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); - if (inner != null) { - return new GitLabGroupListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabGroupImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabGroupImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabGroupImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitLabGroup get(String resourceGroupName, String securityConnectorName, String groupFQName) { - GitLabGroupInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, groupFQName); - if (inner != null) { - return new GitLabGroupImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitLabGroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java deleted file mode 100644 index df5e3c2e83e6c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import com.azure.resourcemanager.security.models.GitLabProject; -import com.azure.resourcemanager.security.models.GitLabProjectProperties; - -public final class GitLabProjectImpl implements GitLabProject { - private GitLabProjectInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitLabProjectImpl(GitLabProjectInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitLabProjectProperties properties() { - return this.innerModel().properties(); - } - - public GitLabProjectInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java deleted file mode 100644 index fdc5209d0ed9c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import com.azure.resourcemanager.security.models.GitLabProjectListResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitLabProjectsClient. - */ -public final class GitLabProjectsClientImpl implements GitLabProjectsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitLabProjectsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitLabProjectsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitLabProjectsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitLabProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitLabProjects to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGitLab") - public interface GitLabProjectsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @PathParam("projectName") String projectName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String groupFQName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, - groupFQName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, groupFQName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, groupFQName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, groupFQName)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, groupFQName, context)); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, String projectName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, projectName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, String projectName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, projectName, apiVersion, accept, context); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, projectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, projectName, context) - .block(); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return gitLab Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabProjectInner get(String resourceGroupName, String securityConnectorName, String groupFQName, - String projectName) { - return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, projectName, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java deleted file mode 100644 index 496f8da7e4920..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import com.azure.resourcemanager.security.models.GitLabProject; -import com.azure.resourcemanager.security.models.GitLabProjects; - -public final class GitLabProjectsImpl implements GitLabProjects { - private static final ClientLogger LOGGER = new ClientLogger(GitLabProjectsImpl.class); - - private final GitLabProjectsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitLabProjectsImpl(GitLabProjectsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String groupFQName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabProjectImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabProjectImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, groupFQName, projectName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabProjectImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitLabProject get(String resourceGroupName, String securityConnectorName, String groupFQName, - String projectName) { - GitLabProjectInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, groupFQName, projectName); - if (inner != null) { - return new GitLabProjectImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitLabProjectsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java deleted file mode 100644 index 7edb6bd323bbf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.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.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitLabSubgroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitLabSubgroupsClient. - */ -public final class GitLabSubgroupsClientImpl implements GitLabSubgroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitLabSubgroupsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitLabSubgroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitLabSubgroupsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitLabSubgroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitLabSubgroups to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGitLab") - public interface GitLabSubgroupsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/listSubgroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2024-05-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, apiVersion, accept, context); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return listWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String securityConnectorName, String groupFQName, Context context) { - return listWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, context).block(); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The GitLab group fully-qualified name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested subgroups of given GitLab Group which are onboarded to the connector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabGroupListResponseInner list(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return listWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java deleted file mode 100644 index b7df246c9ce36..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.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.GitLabSubgroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import com.azure.resourcemanager.security.models.GitLabGroupListResponse; -import com.azure.resourcemanager.security.models.GitLabSubgroups; - -public final class GitLabSubgroupsImpl implements GitLabSubgroups { - private static final ClientLogger LOGGER = new ClientLogger(GitLabSubgroupsImpl.class); - - private final GitLabSubgroupsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitLabSubgroupsImpl(GitLabSubgroupsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GitLabGroupListResponse list(String resourceGroupName, String securityConnectorName, String groupFQName) { - GitLabGroupListResponseInner inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName); - if (inner != null) { - return new GitLabGroupListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitLabSubgroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java deleted file mode 100644 index 0511fd355f7be..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; - -public final class GovernanceAssignmentImpl - implements GovernanceAssignment, GovernanceAssignment.Definition, GovernanceAssignment.Update { - private GovernanceAssignmentInner 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 owner() { - return this.innerModel().owner(); - } - - public OffsetDateTime remediationDueDate() { - return this.innerModel().remediationDueDate(); - } - - public RemediationEta remediationEta() { - return this.innerModel().remediationEta(); - } - - public Boolean isGracePeriod() { - return this.innerModel().isGracePeriod(); - } - - public GovernanceEmailNotification governanceEmailNotification() { - return this.innerModel().governanceEmailNotification(); - } - - public GovernanceAssignmentAdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public GovernanceAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String assessmentName; - - private String assignmentKey; - - public GovernanceAssignmentImpl withExistingAssessment(String scope, String assessmentName) { - this.scope = scope; - this.assessmentName = assessmentName; - return this; - } - - public GovernanceAssignment create() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new GovernanceAssignmentInner(); - this.serviceManager = serviceManager; - this.assignmentKey = name; - } - - public GovernanceAssignmentImpl update() { - return this; - } - - public GovernanceAssignment apply() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceAssignmentImpl(GovernanceAssignmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - this.assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - this.assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - } - - public GovernanceAssignment refresh() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .getWithResponse(scope, assessmentName, assignmentKey, Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .getWithResponse(scope, assessmentName, assignmentKey, context) - .getValue(); - return this; - } - - public GovernanceAssignmentImpl withOwner(String owner) { - this.innerModel().withOwner(owner); - return this; - } - - public GovernanceAssignmentImpl withRemediationDueDate(OffsetDateTime remediationDueDate) { - this.innerModel().withRemediationDueDate(remediationDueDate); - return this; - } - - public GovernanceAssignmentImpl withRemediationEta(RemediationEta remediationEta) { - this.innerModel().withRemediationEta(remediationEta); - return this; - } - - public GovernanceAssignmentImpl withIsGracePeriod(Boolean isGracePeriod) { - this.innerModel().withIsGracePeriod(isGracePeriod); - return this; - } - - public GovernanceAssignmentImpl - withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { - this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - public GovernanceAssignmentImpl withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - this.innerModel().withAdditionalData(additionalData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java deleted file mode 100644 index 7513c0ddc578c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignmentsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. - */ -public final class GovernanceAssignmentsClientImpl implements GovernanceAssignmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GovernanceAssignmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(GovernanceAssignmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceAssignments to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGovern") - public interface GovernanceAssignmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, - @BodyParam("application/json") GovernanceAssignmentInner governanceAssignment, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, 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 governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, 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 governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName, - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName) { - return new PagedIterable<>(listAsync(scope, assessmentName)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment 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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName, Context context) { - return new PagedIterable<>(listAsync(scope, assessmentName, context)); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String assignmentKey) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, - assignmentKey, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String assignmentKey, 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, accept, - context); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String assessmentName, String assignmentKey) { - return getWithResponseAsync(scope, assessmentName, assignmentKey) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String assessmentName, - String assignmentKey, Context context) { - return getWithResponseAsync(scope, assessmentName, assignmentKey, context).block(); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey) { - return getWithResponse(scope, assessmentName, assignmentKey, Context.NONE).getValue(); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - if (governanceAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter governanceAssignment is required and cannot be null.")); - } else { - governanceAssignment.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, assessmentName, - assignmentKey, governanceAssignment, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment, 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - if (governanceAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter governanceAssignment is required and cannot be null.")); - } else { - governanceAssignment.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, - governanceAssignment, accept, context); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, String assessmentName, - String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - return createOrUpdateWithResponseAsync(scope, assessmentName, assignmentKey, governanceAssignment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, String assessmentName, - String assignmentKey, GovernanceAssignmentInner governanceAssignment, Context context) { - return createOrUpdateWithResponseAsync(scope, assessmentName, assignmentKey, governanceAssignment, context) - .block(); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner createOrUpdate(String scope, String assessmentName, String assignmentKey, - GovernanceAssignmentInner governanceAssignment) { - return createOrUpdateWithResponse(scope, assessmentName, assignmentKey, governanceAssignment, Context.NONE) - .getValue(); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String assessmentName, String assignmentKey) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, - assignmentKey, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String assessmentName, String assignmentKey, - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, context); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String assessmentName, String assignmentKey) { - return deleteWithResponseAsync(scope, assessmentName, assignmentKey).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, - Context context) { - return deleteWithResponseAsync(scope, assessmentName, assignmentKey, context).block(); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String assessmentName, String assignmentKey) { - deleteWithResponse(scope, assessmentName, assignmentKey, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java deleted file mode 100644 index 54e9df9a52e2b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (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.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignments; - -public final class GovernanceAssignmentsImpl implements GovernanceAssignments { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceAssignmentsImpl.class); - - private final GovernanceAssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceAssignmentsImpl(GovernanceAssignmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope, String assessmentName) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String scope, String assessmentName, String assignmentKey, - Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, assessmentName, assignmentKey, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GovernanceAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceAssignment get(String scope, String assessmentName, String assignmentKey) { - GovernanceAssignmentInner inner = this.serviceClient().get(scope, assessmentName, assignmentKey); - if (inner != null) { - return new GovernanceAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, - Context context) { - return this.serviceClient().deleteWithResponse(scope, assessmentName, assignmentKey, context); - } - - public void delete(String scope, String assessmentName, String assignmentKey) { - this.serviceClient().delete(scope, assessmentName, assignmentKey); - } - - public GovernanceAssignment getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - return this.getWithResponse(scope, assessmentName, assignmentKey, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - return this.getWithResponse(scope, assessmentName, assignmentKey, context); - } - - public void deleteById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - this.deleteWithResponse(scope, assessmentName, assignmentKey, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - return this.deleteWithResponse(scope, assessmentName, assignmentKey, context); - } - - private GovernanceAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceAssignmentImpl define(String name) { - return new GovernanceAssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java deleted file mode 100644 index e17130f23c344..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Collections; -import java.util.List; - -public final class GovernanceRuleImpl implements GovernanceRule, GovernanceRule.Definition, GovernanceRule.Update { - private GovernanceRuleInner 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 tenantId() { - return this.innerModel().tenantId(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationTimeframe() { - return this.innerModel().remediationTimeframe(); - } - - public Boolean isGracePeriod() { - return this.innerModel().isGracePeriod(); - } - - public int rulePriority() { - return this.innerModel().rulePriority(); - } - - public Boolean isDisabled() { - return this.innerModel().isDisabled(); - } - - public GovernanceRuleType ruleType() { - return this.innerModel().ruleType(); - } - - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.innerModel().sourceResourceType(); - } - - public List excludedScopes() { - List inner = this.innerModel().excludedScopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List conditionSets() { - List inner = this.innerModel().conditionSets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean includeMemberScopes() { - return this.innerModel().includeMemberScopes(); - } - - public GovernanceRuleOwnerSource ownerSource() { - return this.innerModel().ownerSource(); - } - - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.innerModel().governanceEmailNotification(); - } - - public GovernanceRuleMetadata metadata() { - return this.innerModel().metadata(); - } - - public GovernanceRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String ruleId; - - public GovernanceRuleImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public GovernanceRule create() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceRuleImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new GovernanceRuleInner(); - this.serviceManager = serviceManager; - this.ruleId = name; - } - - public GovernanceRuleImpl update() { - return this; - } - - public GovernanceRule apply() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceRuleImpl(GovernanceRuleInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - this.ruleId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - } - - public GovernanceRule refresh() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .getWithResponse(scope, ruleId, Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, context).getValue(); - return this; - } - - public void execute() { - serviceManager.governanceRules().execute(scope, ruleId); - } - - public void execute(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - serviceManager.governanceRules().execute(scope, ruleId, executeGovernanceRuleParams, context); - } - - public GovernanceRuleImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public GovernanceRuleImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public GovernanceRuleImpl withRemediationTimeframe(String remediationTimeframe) { - this.innerModel().withRemediationTimeframe(remediationTimeframe); - return this; - } - - public GovernanceRuleImpl withIsGracePeriod(Boolean isGracePeriod) { - this.innerModel().withIsGracePeriod(isGracePeriod); - return this; - } - - public GovernanceRuleImpl withRulePriority(int rulePriority) { - this.innerModel().withRulePriority(rulePriority); - return this; - } - - public GovernanceRuleImpl withIsDisabled(Boolean isDisabled) { - this.innerModel().withIsDisabled(isDisabled); - return this; - } - - public GovernanceRuleImpl withRuleType(GovernanceRuleType ruleType) { - this.innerModel().withRuleType(ruleType); - return this; - } - - public GovernanceRuleImpl withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - this.innerModel().withSourceResourceType(sourceResourceType); - return this; - } - - public GovernanceRuleImpl withExcludedScopes(List excludedScopes) { - this.innerModel().withExcludedScopes(excludedScopes); - return this; - } - - public GovernanceRuleImpl withConditionSets(List conditionSets) { - this.innerModel().withConditionSets(conditionSets); - return this; - } - - public GovernanceRuleImpl withIncludeMemberScopes(Boolean includeMemberScopes) { - this.innerModel().withIncludeMemberScopes(includeMemberScopes); - return this; - } - - public GovernanceRuleImpl withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - this.innerModel().withOwnerSource(ownerSource); - return this; - } - - public GovernanceRuleImpl - withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { - this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - public GovernanceRuleImpl withMetadata(GovernanceRuleMetadata metadata) { - this.innerModel().withMetadata(metadata); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java deleted file mode 100644 index 3afd98b23e9b5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java +++ /dev/null @@ -1,1222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRuleList; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GovernanceRulesClient. - */ -public final class GovernanceRulesClientImpl implements GovernanceRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final GovernanceRulesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceRulesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GovernanceRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceRules to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGovern") - public interface GovernanceRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/governanceRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, @BodyParam("application/json") GovernanceRuleInner governanceRule, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono operationResults(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, @PathParam("operationId") String operationId, - @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 a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String ruleId) { - 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String ruleId, 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String ruleId) { - return getWithResponseAsync(scope, ruleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String ruleId, Context context) { - return getWithResponseAsync(scope, ruleId, context).block(); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 specific governance rule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner get(String scope, String ruleId) { - return getWithResponse(scope, ruleId, Context.NONE).getValue(); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String ruleId, - GovernanceRuleInner governanceRule) { - 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, - governanceRule, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String ruleId, - GovernanceRuleInner governanceRule, 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, - context); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, String ruleId, - GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, String ruleId, - GovernanceRuleInner governanceRule, Context context) { - return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule, context).block(); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponse(scope, ruleId, governanceRule, Context.NONE).getValue(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String scope, String ruleId) { - 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String scope, String ruleId, 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String scope, String ruleId) { - Mono>> mono = deleteWithResponseAsync(scope, ruleId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String scope, String ruleId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(scope, ruleId, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String scope, String ruleId) { - return this.beginDeleteAsync(scope, ruleId).getSyncPoller(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String scope, String ruleId, Context context) { - return this.beginDeleteAsync(scope, ruleId, context).getSyncPoller(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String ruleId) { - return beginDeleteAsync(scope, ruleId).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String ruleId, Context context) { - return beginDeleteAsync(scope, ruleId, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 scope, String ruleId) { - deleteAsync(scope, ruleId).block(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String ruleId, Context context) { - deleteAsync(scope, ruleId, context).block(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> executeWithResponseAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, scope, ruleId, - executeGovernanceRuleParams, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> executeWithResponseAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, 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 (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, scope, ruleId, executeGovernanceRuleParams, - accept, context); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteAsync(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginExecute(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).getSyncPoller(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginExecute(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context).getSyncPoller(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (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 execute(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - executeAsync(scope, ruleId, executeGovernanceRuleParams).block(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - executeAsync(scope, ruleId, executeGovernanceRuleParams, context).block(); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync(String scope, String ruleId, - String operationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.operationResults(this.client.getEndpoint(), apiVersion, scope, ruleId, - operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync(String scope, String ruleId, - String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.operationResults(this.client.getEndpoint(), apiVersion, scope, ruleId, operationId, accept, - context); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsAsync(String scope, String ruleId, - String operationId) { - return operationResultsWithResponseAsync(scope, ruleId, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRulesOperationResultsResponse operationResultsWithResponse(String scope, String ruleId, - String operationId, Context context) { - return operationResultsWithResponseAsync(scope, ruleId, operationId, context).block(); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultAutoGeneratedInner operationResults(String scope, String ruleId, String operationId) { - return operationResultsWithResponse(scope, ruleId, operationId, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a governance rules list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a governance rules list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java deleted file mode 100644 index d225d2c02b165..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (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.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; -import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; - -public final class GovernanceRulesImpl implements GovernanceRules { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRulesImpl.class); - - private final GovernanceRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceRulesImpl(GovernanceRulesClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String scope, String ruleId, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, ruleId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GovernanceRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceRule get(String scope, String ruleId) { - GovernanceRuleInner inner = this.serviceClient().get(scope, ruleId); - if (inner != null) { - return new GovernanceRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String scope, String ruleId) { - this.serviceClient().delete(scope, ruleId); - } - - public void delete(String scope, String ruleId, Context context) { - this.serviceClient().delete(scope, ruleId, context); - } - - public void execute(String scope, String ruleId) { - this.serviceClient().execute(scope, ruleId); - } - - public void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - this.serviceClient().execute(scope, ruleId, executeGovernanceRuleParams, context); - } - - public Response operationResultsWithResponse(String scope, String ruleId, - String operationId, Context context) { - GovernanceRulesOperationResultsResponse inner - = this.serviceClient().operationResultsWithResponse(scope, ruleId, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationResultAutoGeneratedImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationResultAutoGenerated operationResults(String scope, String ruleId, String operationId) { - OperationResultAutoGeneratedInner inner = this.serviceClient().operationResults(scope, ruleId, operationId); - if (inner != null) { - return new OperationResultAutoGeneratedImpl(inner, this.manager()); - } else { - return null; - } - } - - public GovernanceRule getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(scope, ruleId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(scope, ruleId, context); - } - - public void deleteById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.delete(scope, ruleId, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.delete(scope, ruleId, context); - } - - private GovernanceRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceRuleImpl define(String name) { - return new GovernanceRuleImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java deleted file mode 100644 index f238c398a50cb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.Issue; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.StatusAutoGenerated; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class HealthReportImpl implements HealthReport { - private HealthReportInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - HealthReportImpl(HealthReportInner 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 ResourceDetailsAutoGenerated resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public EnvironmentDetails environmentDetails() { - return this.innerModel().environmentDetails(); - } - - public HealthDataClassification healthDataClassification() { - return this.innerModel().healthDataClassification(); - } - - public StatusAutoGenerated status() { - return this.innerModel().status(); - } - - public List affectedDefendersPlans() { - List inner = this.innerModel().affectedDefendersPlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List affectedDefendersSubPlans() { - List inner = this.innerModel().affectedDefendersSubPlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Map reportAdditionalData() { - Map inner = this.innerModel().reportAdditionalData(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public List issues() { - List inner = this.innerModel().issues(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public HealthReportInner 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/HealthReportsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java deleted file mode 100644 index b3439347d4ecf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReportsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in HealthReportsClient. - */ -public final class HealthReportsClientImpl implements HealthReportsClient { - /** - * The proxy service used to perform REST calls. - */ - private final HealthReportsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of HealthReportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HealthReportsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(HealthReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterHealthReports to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterHealth") - public interface HealthReportsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/healthReports") - @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("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("healthReportName") String healthReportName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2023-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2023-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String healthReportName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String healthReportName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String healthReportName) { - return getWithResponseAsync(resourceId, healthReportName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - return getWithResponseAsync(resourceId, healthReportName, context).block(); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthReportInner get(String resourceId, String healthReportName) { - return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of health reports list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of health reports list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java deleted file mode 100644 index 4fea8a3b2f191..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReports; - -public final class HealthReportsImpl implements HealthReports { - private static final ClientLogger LOGGER = new ClientLogger(HealthReportsImpl.class); - - private final HealthReportsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public HealthReportsImpl(HealthReportsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HealthReportImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public HealthReport get(String resourceId, String healthReportName) { - HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName); - if (inner != null) { - return new HealthReportImpl(inner, this.manager()); - } else { - return null; - } - } - - private HealthReportsClient serviceClient() { - return this.innerClient; - } - - 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/InformationProtectionPoliciesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java deleted file mode 100644 index 907272011fcda..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyList; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in InformationProtectionPoliciesClient. - */ -public final class InformationProtectionPoliciesClientImpl implements InformationProtectionPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final InformationProtectionPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of InformationProtectionPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InformationProtectionPoliciesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(InformationProtectionPoliciesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterInformationProtectionPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterInform") - public interface InformationProtectionPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") InformationProtectionPolicyName informationProtectionPolicyName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @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("informationProtectionPolicyName") InformationProtectionPolicyName informationProtectionPolicyName, - @BodyParam("application/json") InformationProtectionPolicyInner informationProtectionPolicy, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies") - @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("{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); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - 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 (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, - informationProtectionPolicyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, 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 (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, accept, - context); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - return getWithResponseAsync(scope, informationProtectionPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - return getWithResponseAsync(scope, informationProtectionPolicyName, context).block(); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner get(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - return getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - 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 (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - if (informationProtectionPolicy == null) { - return Mono.error( - new IllegalArgumentException("Parameter informationProtectionPolicy is required and cannot be null.")); - } else { - informationProtectionPolicy.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, - informationProtectionPolicyName, informationProtectionPolicy, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, 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 (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - if (informationProtectionPolicy == null) { - return Mono.error( - new IllegalArgumentException("Parameter informationProtectionPolicy is required and cannot be null.")); - } else { - informationProtectionPolicy.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, - informationProtectionPolicy, accept, context); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, Context context) { - return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy, - context).block(); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner createOrUpdate(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponse(scope, informationProtectionPolicyName, informationProtectionPolicy, - Context.NONE).getValue(); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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())); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java deleted file mode 100644 index a4e09b7273f7a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (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.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -public final class InformationProtectionPoliciesImpl implements InformationProtectionPolicies { - private static final ClientLogger LOGGER = new ClientLogger(InformationProtectionPoliciesImpl.class); - - private final InformationProtectionPoliciesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public InformationProtectionPoliciesImpl(InformationProtectionPoliciesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, informationProtectionPolicyName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new InformationProtectionPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public InformationProtectionPolicy get(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - InformationProtectionPolicyInner inner = this.serviceClient().get(scope, informationProtectionPolicyName); - if (inner != null) { - return new InformationProtectionPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); - } - - public InformationProtectionPolicy getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String informationProtectionPolicyNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); - if (informationProtectionPolicyNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'informationProtectionPolicies'.", id))); - } - InformationProtectionPolicyName informationProtectionPolicyName - = InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); - return this.getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String informationProtectionPolicyNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); - if (informationProtectionPolicyNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'informationProtectionPolicies'.", id))); - } - InformationProtectionPolicyName informationProtectionPolicyName - = InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); - return this.getWithResponse(scope, informationProtectionPolicyName, context); - } - - private InformationProtectionPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public InformationProtectionPolicyImpl define(InformationProtectionPolicyName name) { - return new InformationProtectionPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java deleted file mode 100644 index 9605b4e41e599..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class InformationProtectionPolicyImpl - implements InformationProtectionPolicy, InformationProtectionPolicy.Definition, InformationProtectionPolicy.Update { - private InformationProtectionPolicyInner 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 OffsetDateTime lastModifiedUtc() { - return this.innerModel().lastModifiedUtc(); - } - - public String version() { - return this.innerModel().version(); - } - - public Map labels() { - Map inner = this.innerModel().labels(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Map informationTypes() { - Map inner = this.innerModel().informationTypes(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public InformationProtectionPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private InformationProtectionPolicyName informationProtectionPolicyName; - - public InformationProtectionPolicyImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public InformationProtectionPolicy create() { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - InformationProtectionPolicyImpl(InformationProtectionPolicyName name, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new InformationProtectionPolicyInner(); - this.serviceManager = serviceManager; - this.informationProtectionPolicyName = name; - } - - public InformationProtectionPolicyImpl update() { - return this; - } - - public InformationProtectionPolicy apply() { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - InformationProtectionPolicyImpl(InformationProtectionPolicyInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - this.informationProtectionPolicyName = InformationProtectionPolicyName - .fromString(ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName")); - } - - public InformationProtectionPolicy refresh() { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .getWithResponse(scope, informationProtectionPolicyName, Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .getWithResponse(scope, informationProtectionPolicyName, context) - .getValue(); - return this; - } - - public InformationProtectionPolicyImpl withLabels(Map labels) { - this.innerModel().withLabels(labels); - return this; - } - - public InformationProtectionPolicyImpl withInformationTypes(Map informationTypes) { - this.innerModel().withInformationTypes(informationTypes); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java deleted file mode 100644 index 0d12c312f49fd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocationList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LocationsClient. - */ -public final class LocationsClientImpl implements LocationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LocationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of LocationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterLocations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterLocati") - public interface LocationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations") - @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/locations/{ascLocation}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @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); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-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())); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-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)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ascLocation) { - 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ascLocation, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, accept, - context); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ascLocation) { - return getWithResponseAsync(ascLocation).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ascLocation, Context context) { - return getWithResponseAsync(ascLocation, context).block(); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AscLocationInner get(String ascLocation) { - return getWithResponse(ascLocation, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java deleted file mode 100644 index cc476cfd3e1fe..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.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.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.LocationsClient; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocation; -import com.azure.resourcemanager.security.models.Locations; - -public final class LocationsImpl implements Locations { - private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); - - private final LocationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public LocationsImpl(LocationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); - } - - public Response getWithResponse(String ascLocation, Context context) { - Response inner = this.serviceClient().getWithResponse(ascLocation, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AscLocationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AscLocation get(String ascLocation) { - AscLocationInner inner = this.serviceClient().get(ascLocation); - if (inner != null) { - return new AscLocationImpl(inner, this.manager()); - } else { - return null; - } - } - - private LocationsClient 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/MalwareScanImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MalwareScanImpl.java deleted file mode 100644 index 4c5abf4089776..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MalwareScanImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.MalwareScan; -import com.azure.resourcemanager.security.models.MalwareScanProperties; - -public final class MalwareScanImpl implements MalwareScan { - private MalwareScanInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MalwareScanImpl(MalwareScanInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public MalwareScanProperties properties() { - return this.innerModel().properties(); - } - - public MalwareScanInner 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/MdeOnboardingDataImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java deleted file mode 100644 index bc505796e77cb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.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.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; - -public final class MdeOnboardingDataImpl implements MdeOnboardingData { - private MdeOnboardingDataInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MdeOnboardingDataImpl(MdeOnboardingDataInner 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 byte[] onboardingPackageWindows() { - return this.innerModel().onboardingPackageWindows(); - } - - public byte[] onboardingPackageLinux() { - return this.innerModel().onboardingPackageLinux(); - } - - public MdeOnboardingDataInner 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/MdeOnboardingDataListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java deleted file mode 100644 index 8b7a9a39cad1b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.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.implementation; - -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 MdeOnboardingDataListImpl implements MdeOnboardingDataList { - private MdeOnboardingDataListInner innerObject; - - private final 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(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new MdeOnboardingDataImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public MdeOnboardingDataListInner 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/MdeOnboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java deleted file mode 100644 index d0367a847d38e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.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 MdeOnboardingsClient. - */ -public final class MdeOnboardingsClientImpl implements MdeOnboardingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final MdeOnboardingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of MdeOnboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MdeOnboardingsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(MdeOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterMdeOnboardings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterMdeOnb") - public interface MdeOnboardingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings") - @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/mdeOnboardings/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); - } - - /** - * 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 all MDE onboarding data resources along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-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())); - } - - /** - * 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 all MDE onboarding data resources along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - 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); - } - - /** - * 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 all MDE onboarding data resources on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 all MDE onboarding data resources along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * 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 all MDE onboarding data resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MdeOnboardingDataListInner list() { - return listWithResponse(Context.NONE).getValue(); - } - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-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())); - } - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * The default 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 the resource of the configuration or data needed to onboard the machine to MDE. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MdeOnboardingDataInner get() { - return getWithResponse(Context.NONE).getValue(); - } -} 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 deleted file mode 100644 index ad745ba5a6f9e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.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.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; - -public final class MdeOnboardingsImpl implements MdeOnboardings { - private static 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 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 MdeOnboardingDataList list() { - MdeOnboardingDataListInner inner = this.serviceClient().list(); - if (inner != null) { - return new MdeOnboardingDataListImpl(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; - } - } - - public MdeOnboardingData get() { - MdeOnboardingDataInner inner = this.serviceClient().get(); - if (inner != null) { - return new MdeOnboardingDataImpl(inner, 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/OperationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java deleted file mode 100644 index 75c220f621c89..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.ActionType; -import com.azure.resourcemanager.security.models.Operation; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.azure.resourcemanager.security.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java deleted file mode 100644 index bbeb3b70d2c4f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.OperationResult; -import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; - -public final class OperationResultAutoGeneratedImpl implements OperationResultAutoGenerated { - private OperationResultAutoGeneratedInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationResultAutoGeneratedImpl(OperationResultAutoGeneratedInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public OperationResult status() { - return this.innerModel().status(); - } - - public OperationResultAutoGeneratedInner 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/OperationStatusResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java deleted file mode 100644 index a78430c5f0266..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.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.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.security.models.OperationStatusResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class OperationStatusResultImpl implements OperationStatusResult { - private OperationStatusResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationStatusResultImpl(OperationStatusResultInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public Float percentComplete() { - return this.innerModel().percentComplete(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public OperationStatusResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java deleted file mode 100644 index fabc4191bddaf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOperations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterOperat") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2024-10-01-preview"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 = "2024-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, 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/OperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java deleted file mode 100644 index b40714e8b3e83..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.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.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.OperationsClient; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.Operation; -import com.azure.resourcemanager.security.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java deleted file mode 100644 index 8345f2183601e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.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.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceAssessmentImpl implements RegulatoryComplianceAssessment { - private RegulatoryComplianceAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceAssessmentImpl(RegulatoryComplianceAssessmentInner 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 description() { - return this.innerModel().description(); - } - - public String assessmentType() { - return this.innerModel().assessmentType(); - } - - public String assessmentDetailsLink() { - return this.innerModel().assessmentDetailsLink(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedResources() { - return this.innerModel().passedResources(); - } - - public Integer failedResources() { - return this.innerModel().failedResources(); - } - - public Integer skippedResources() { - return this.innerModel().skippedResources(); - } - - public Integer unsupportedResources() { - return this.innerModel().unsupportedResources(); - } - - public RegulatoryComplianceAssessmentInner 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/RegulatoryComplianceAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java deleted file mode 100644 index b078f836e8ada..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessmentList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. - */ -public final class RegulatoryComplianceAssessmentsClientImpl implements RegulatoryComplianceAssessmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RegulatoryComplianceAssessmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceAssessmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(RegulatoryComplianceAssessmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceAssessments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterRegula") - public interface RegulatoryComplianceAssessmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @PathParam("regulatoryComplianceAssessmentName") String regulatoryComplianceAssessmentName, - @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); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, - regulatoryComplianceControlName, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - final String filter = null; - return new PagedIterable<>( - listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context) { - return new PagedIterable<>( - listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context)); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - if (regulatoryComplianceAssessmentName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - if (regulatoryComplianceAssessmentName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, - accept, context); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, context).block(); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceAssessmentInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { - return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java deleted file mode 100644 index 6148dd03e3a23..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; - -public final class RegulatoryComplianceAssessmentsImpl implements RegulatoryComplianceAssessments { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceAssessmentsImpl.class); - - private final RegulatoryComplianceAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceAssessmentsImpl(RegulatoryComplianceAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - PagedIterable inner - = this.serviceClient().list(regulatoryComplianceStandardName, regulatoryComplianceControlName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context) { - PagedIterable inner = this.serviceClient() - .list(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegulatoryComplianceAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegulatoryComplianceAssessment get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { - RegulatoryComplianceAssessmentInner inner = this.serviceClient() - .get(regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName); - if (inner != null) { - return new RegulatoryComplianceAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - private RegulatoryComplianceAssessmentsClient 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/RegulatoryComplianceControlImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java deleted file mode 100644 index 9c60baec0bd40..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceControlImpl implements RegulatoryComplianceControl { - private RegulatoryComplianceControlInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceControlImpl(RegulatoryComplianceControlInner 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 description() { - return this.innerModel().description(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedAssessments() { - return this.innerModel().passedAssessments(); - } - - public Integer failedAssessments() { - return this.innerModel().failedAssessments(); - } - - public Integer skippedAssessments() { - return this.innerModel().skippedAssessments(); - } - - public RegulatoryComplianceControlInner 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/RegulatoryComplianceControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java deleted file mode 100644 index 31ff14d5522d6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControlList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. - */ -public final class RegulatoryComplianceControlsClientImpl implements RegulatoryComplianceControlsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RegulatoryComplianceControlsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceControlsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceControlsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(RegulatoryComplianceControlsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceControls to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterRegula") - public interface RegulatoryComplianceControlsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @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); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String regulatoryComplianceStandardName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String regulatoryComplianceStandardName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName) { - final String filter = null; - return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName, String filter, - Context context) { - return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter, context)); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, accept, context); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, context).block(); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceControlInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java deleted file mode 100644 index 253dcaf1bbf58..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.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.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.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; - -public final class RegulatoryComplianceControlsImpl implements RegulatoryComplianceControls { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceControlsImpl.class); - - private final RegulatoryComplianceControlsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceControlsImpl(RegulatoryComplianceControlsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String regulatoryComplianceStandardName) { - PagedIterable inner - = this.serviceClient().list(regulatoryComplianceStandardName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); - } - - public PagedIterable list(String regulatoryComplianceStandardName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().list(regulatoryComplianceStandardName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); - } - - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegulatoryComplianceControlImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegulatoryComplianceControl get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - RegulatoryComplianceControlInner inner - = this.serviceClient().get(regulatoryComplianceStandardName, regulatoryComplianceControlName); - if (inner != null) { - return new RegulatoryComplianceControlImpl(inner, this.manager()); - } else { - return null; - } - } - - private RegulatoryComplianceControlsClient 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/RegulatoryComplianceStandardImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java deleted file mode 100644 index ac80baff85296..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceStandardImpl implements RegulatoryComplianceStandard { - private RegulatoryComplianceStandardInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceStandardImpl(RegulatoryComplianceStandardInner 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 State state() { - return this.innerModel().state(); - } - - public Integer passedControls() { - return this.innerModel().passedControls(); - } - - public Integer failedControls() { - return this.innerModel().failedControls(); - } - - public Integer skippedControls() { - return this.innerModel().skippedControls(); - } - - public Integer unsupportedControls() { - return this.innerModel().unsupportedControls(); - } - - public RegulatoryComplianceStandardInner 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/RegulatoryComplianceStandardsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java deleted file mode 100644 index dd500ef104262..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. - */ -public final class RegulatoryComplianceStandardsClientImpl implements RegulatoryComplianceStandardsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RegulatoryComplianceStandardsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceStandardsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceStandardsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(RegulatoryComplianceStandardsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceStandards to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterRegula") - public interface RegulatoryComplianceStandardsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @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); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String regulatoryComplianceStandardName) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String regulatoryComplianceStandardName, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, accept, context); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName) { - return getWithResponseAsync(regulatoryComplianceStandardName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String regulatoryComplianceStandardName, - Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, context).block(); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceStandardInner get(String regulatoryComplianceStandardName) { - return getWithResponse(regulatoryComplianceStandardName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java deleted file mode 100644 index b6a36939c29e0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; - -public final class RegulatoryComplianceStandardsImpl implements RegulatoryComplianceStandards { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceStandardsImpl.class); - - private final RegulatoryComplianceStandardsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceStandardsImpl(RegulatoryComplianceStandardsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); - } - - public Response getWithResponse(String regulatoryComplianceStandardName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(regulatoryComplianceStandardName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegulatoryComplianceStandardImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegulatoryComplianceStandard get(String regulatoryComplianceStandardName) { - RegulatoryComplianceStandardInner inner = this.serviceClient().get(regulatoryComplianceStandardName); - if (inner != null) { - return new RegulatoryComplianceStandardImpl(inner, this.manager()); - } else { - return null; - } - } - - private RegulatoryComplianceStandardsClient 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/RuleResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java deleted file mode 100644 index 2fea217b5484c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.List; - -public final class RuleResultsImpl implements RuleResults, RuleResults.Definition, RuleResults.Update { - private RuleResultsInner 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 RuleResultsProperties properties() { - return this.innerModel().properties(); - } - - public RuleResultsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String ruleId; - - private String resourceId; - - private String createWorkspaceId; - - private RuleResultsInput createBody; - - private String updateWorkspaceId; - - private RuleResultsInput updateBody; - - public RuleResultsImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public RuleResults create() { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, Context.NONE) - .getValue(); - return this; - } - - public RuleResults create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, context) - .getValue(); - return this; - } - - RuleResultsImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new RuleResultsInner(); - this.serviceManager = serviceManager; - this.ruleId = name; - this.createWorkspaceId = null; - this.createBody = new RuleResultsInput(); - } - - public RuleResultsImpl update() { - this.updateWorkspaceId = null; - this.updateBody = new RuleResultsInput(); - return this; - } - - public RuleResults apply() { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, Context.NONE) - .getValue(); - return this; - } - - public RuleResults apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, context) - .getValue(); - return this; - } - - RuleResultsImpl(RuleResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.ruleId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - this.resourceId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - } - - public RuleResultsImpl withLatestScan(Boolean latestScan) { - if (isInCreateMode()) { - this.createBody.withLatestScan(latestScan); - return this; - } else { - this.updateBody.withLatestScan(latestScan); - return this; - } - } - - public RuleResultsImpl withResults(List> results) { - if (isInCreateMode()) { - this.createBody.withResults(results); - return this; - } else { - this.updateBody.withResults(results); - return this; - } - } - - public RuleResultsImpl withWorkspaceId(String workspaceId) { - if (isInCreateMode()) { - this.createWorkspaceId = workspaceId; - return this; - } else { - this.updateWorkspaceId = workspaceId; - 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/RulesResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java deleted file mode 100644 index 6daf8a684865d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RulesResults; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class RulesResultsImpl implements RulesResults { - private RulesResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RulesResultsImpl(RulesResultsInner 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 RuleResultsImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public RulesResultsInner 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/ScanImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanImpl.java deleted file mode 100644 index d9478f1ddc00e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.ScanProperties; - -public final class ScanImpl implements Scan { - private ScanInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanImpl(ScanInner 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 ScanProperties properties() { - return this.innerModel().properties(); - } - - public ScanInner 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/ScanResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java deleted file mode 100644 index cfda06c821fe1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResultProperties; - -public final class ScanResultImpl implements ScanResult { - private ScanResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanResultImpl(ScanResultInner 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 ScanResultProperties properties() { - return this.innerModel().properties(); - } - - public ScanResultInner 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/ScanResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java deleted file mode 100644 index b6497100bdfd0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResults; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ScanResultsImpl implements ScanResults { - private ScanResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanResultsImpl(ScanResultsInner 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 ScanResultImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ScanResultsInner 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/ScansImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java deleted file mode 100644 index 8c61fe7739eac..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.Scans; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ScansImpl implements Scans { - private ScansInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScansImpl(ScansInner 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 ScanImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ScansInner 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/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java index 7badc7ffe7669..b8383d446a784 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 @@ -25,78 +25,33 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.security.fluent.AdvancedThreatProtectionsClient; import com.azure.resourcemanager.security.fluent.AlertsClient; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.ApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; import com.azure.resourcemanager.security.fluent.AssessmentsClient; import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.AzureDevOpsOrgsClient; -import com.azure.resourcemanager.security.fluent.AzureDevOpsProjectsClient; -import com.azure.resourcemanager.security.fluent.AzureDevOpsReposClient; import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.ConnectorsClient; -import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; -import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; import com.azure.resourcemanager.security.fluent.CustomRecommendationsClient; -import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; -import com.azure.resourcemanager.security.fluent.DevOpsConfigurationsClient; -import com.azure.resourcemanager.security.fluent.DevOpsOperationResultsClient; -import com.azure.resourcemanager.security.fluent.DevOpsPoliciesClient; -import com.azure.resourcemanager.security.fluent.DevOpsPolicyAssignmentsClient; import com.azure.resourcemanager.security.fluent.DeviceSecurityGroupsClient; import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; -import com.azure.resourcemanager.security.fluent.GitHubReposClient; -import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; -import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; -import com.azure.resourcemanager.security.fluent.GitLabSubgroupsClient; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; 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.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.LocationsClient; -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; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; 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.SecurityConnectorApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; import com.azure.resourcemanager.security.fluent.SecurityStandardsClient; -import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsClient; import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; import com.azure.resourcemanager.security.fluent.SettingsClient; -import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; import com.azure.resourcemanager.security.fluent.StandardAssignmentsClient; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.TasksClient; import com.azure.resourcemanager.security.fluent.TopologiesClient; -import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -181,636 +136,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** - * The LocationsClient object to access its operations. - */ - private final LocationsClient locations; - - /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. - */ - public LocationsClient getLocations() { - return this.locations; - } - - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * The TasksClient object to access its operations. - */ - private final TasksClient tasks; - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - public TasksClient getTasks() { - return this.tasks; - } - - /** - * The AutoProvisioningSettingsClient object to access its operations. - */ - private final AutoProvisioningSettingsClient autoProvisioningSettings; - - /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. - */ - public AutoProvisioningSettingsClient getAutoProvisioningSettings() { - return this.autoProvisioningSettings; - } - - /** - * The CompliancesClient object to access its operations. - */ - private final CompliancesClient compliances; - - /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. - */ - public CompliancesClient getCompliances() { - return this.compliances; - } - - /** - * The InformationProtectionPoliciesClient object to access its operations. - */ - private final InformationProtectionPoliciesClient informationProtectionPolicies; - - /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. - */ - public InformationProtectionPoliciesClient getInformationProtectionPolicies() { - return this.informationProtectionPolicies; - } - - /** - * The WorkspaceSettingsClient object to access its operations. - */ - private final WorkspaceSettingsClient workspaceSettings; - - /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. - */ - public WorkspaceSettingsClient getWorkspaceSettings() { - return this.workspaceSettings; - } - - /** - * The AlertsSuppressionRulesClient object to access its operations. - */ - private final AlertsSuppressionRulesClient alertsSuppressionRules; - - /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. - */ - public AlertsSuppressionRulesClient getAlertsSuppressionRules() { - return this.alertsSuppressionRules; - } - - /** - * The RegulatoryComplianceStandardsClient object to access its operations. - */ - private final RegulatoryComplianceStandardsClient regulatoryComplianceStandards; - - /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. - */ - public RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards() { - return this.regulatoryComplianceStandards; - } - - /** - * The RegulatoryComplianceControlsClient object to access its operations. - */ - private final RegulatoryComplianceControlsClient regulatoryComplianceControls; - - /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. - */ - public RegulatoryComplianceControlsClient getRegulatoryComplianceControls() { - return this.regulatoryComplianceControls; - } - - /** - * The RegulatoryComplianceAssessmentsClient object to access its operations. - */ - private final RegulatoryComplianceAssessmentsClient regulatoryComplianceAssessments; - - /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. - */ - public RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments() { - return this.regulatoryComplianceAssessments; - } - - /** - * The SubAssessmentsClient object to access its operations. - */ - private final SubAssessmentsClient subAssessments; - - /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. - */ - public SubAssessmentsClient getSubAssessments() { - return this.subAssessments; - } - - /** - * The ConnectorsClient object to access its operations. - */ - private final ConnectorsClient connectors; - - /** - * Gets the ConnectorsClient object to access its operations. - * - * @return the ConnectorsClient object. - */ - public ConnectorsClient getConnectors() { - return this.connectors; - } - - /** - * The SoftwareInventoriesClient object to access its operations. - */ - private final SoftwareInventoriesClient softwareInventories; - - /** - * Gets the SoftwareInventoriesClient object to access its operations. - * - * @return the SoftwareInventoriesClient object. - */ - public SoftwareInventoriesClient getSoftwareInventories() { - return this.softwareInventories; - } - - /** - * 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 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 GovernanceAssignmentsClient object to access its operations. - */ - private final GovernanceAssignmentsClient governanceAssignments; - - /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. - */ - public GovernanceAssignmentsClient getGovernanceAssignments() { - return this.governanceAssignments; - } - - /** - * The GovernanceRulesClient object to access its operations. - */ - private final GovernanceRulesClient governanceRules; - - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. - */ - public GovernanceRulesClient getGovernanceRules() { - return this.governanceRules; - } - - /** - * The ApplicationsClient object to access its operations. - */ - private final ApplicationsClient applications; - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - public ApplicationsClient getApplications() { - return this.applications; - } - - /** - * The ApplicationOperationsClient object to access its operations. - */ - private final ApplicationOperationsClient applicationOperations; - - /** - * Gets the ApplicationOperationsClient object to access its operations. - * - * @return the ApplicationOperationsClient object. - */ - public ApplicationOperationsClient getApplicationOperations() { - return this.applicationOperations; - } - - /** - * The SecurityConnectorApplicationsClient object to access its operations. - */ - private final SecurityConnectorApplicationsClient securityConnectorApplications; - - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. - */ - public SecurityConnectorApplicationsClient getSecurityConnectorApplications() { - return this.securityConnectorApplications; - } - - /** - * The SecurityConnectorApplicationOperationsClient object to access its operations. - */ - private final SecurityConnectorApplicationOperationsClient securityConnectorApplicationOperations; - - /** - * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationOperationsClient object. - */ - public SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations() { - return this.securityConnectorApplicationOperations; - } - - /** - * The DefenderForStoragesClient object to access its operations. - */ - private final DefenderForStoragesClient defenderForStorages; - - /** - * Gets the DefenderForStoragesClient object to access its operations. - * - * @return the DefenderForStoragesClient object. - */ - public DefenderForStoragesClient getDefenderForStorages() { - return this.defenderForStorages; - } - - /** - * The SecurityOperatorsClient object to access its operations. - */ - private final SecurityOperatorsClient securityOperators; - - /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. - */ - public SecurityOperatorsClient getSecurityOperators() { - return this.securityOperators; - } - - /** - * The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { - return this.sqlVulnerabilityAssessmentBaselineRules; - } - - /** - * The SqlVulnerabilityAssessmentScansClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { - return this.sqlVulnerabilityAssessmentScans; - } - - /** - * The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { - return this.sqlVulnerabilityAssessmentScanResults; - } - - /** - * The SensitivitySettingsClient object to access its operations. - */ - private final SensitivitySettingsClient sensitivitySettings; - - /** - * Gets the SensitivitySettingsClient object to access its operations. - * - * @return the SensitivitySettingsClient object. - */ - public SensitivitySettingsClient getSensitivitySettings() { - return this.sensitivitySettings; - } - - /** - * The HealthReportsClient object to access its operations. - */ - private final HealthReportsClient healthReports; - - /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. - */ - public HealthReportsClient getHealthReports() { - return this.healthReports; - } - - /** - * The AutomationsClient object to access its operations. - */ - private final AutomationsClient automations; - - /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. - */ - public AutomationsClient getAutomations() { - return this.automations; - } - - /** - * The SecurityContactsClient object to access its operations. - */ - private final SecurityContactsClient securityContacts; - - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. - */ - public SecurityContactsClient getSecurityContacts() { - return this.securityContacts; - } - - /** - * 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; - } - - /** - * The AzureDevOpsOrgsClient object to access its operations. - */ - private final AzureDevOpsOrgsClient azureDevOpsOrgs; - - /** - * Gets the AzureDevOpsOrgsClient object to access its operations. - * - * @return the AzureDevOpsOrgsClient object. - */ - public AzureDevOpsOrgsClient getAzureDevOpsOrgs() { - return this.azureDevOpsOrgs; - } - - /** - * The AzureDevOpsProjectsClient object to access its operations. - */ - private final AzureDevOpsProjectsClient azureDevOpsProjects; - - /** - * Gets the AzureDevOpsProjectsClient object to access its operations. - * - * @return the AzureDevOpsProjectsClient object. - */ - public AzureDevOpsProjectsClient getAzureDevOpsProjects() { - return this.azureDevOpsProjects; - } - - /** - * The AzureDevOpsReposClient object to access its operations. - */ - private final AzureDevOpsReposClient azureDevOpsRepos; - - /** - * Gets the AzureDevOpsReposClient object to access its operations. - * - * @return the AzureDevOpsReposClient object. - */ - public AzureDevOpsReposClient getAzureDevOpsRepos() { - return this.azureDevOpsRepos; - } - - /** - * The DevOpsConfigurationsClient object to access its operations. - */ - private final DevOpsConfigurationsClient devOpsConfigurations; - - /** - * Gets the DevOpsConfigurationsClient object to access its operations. - * - * @return the DevOpsConfigurationsClient object. - */ - public DevOpsConfigurationsClient getDevOpsConfigurations() { - return this.devOpsConfigurations; - } - - /** - * The DevOpsPoliciesClient object to access its operations. - */ - private final DevOpsPoliciesClient devOpsPolicies; - - /** - * Gets the DevOpsPoliciesClient object to access its operations. - * - * @return the DevOpsPoliciesClient object. - */ - public DevOpsPoliciesClient getDevOpsPolicies() { - return this.devOpsPolicies; - } - - /** - * The DevOpsPolicyAssignmentsClient object to access its operations. - */ - private final DevOpsPolicyAssignmentsClient devOpsPolicyAssignments; - - /** - * Gets the DevOpsPolicyAssignmentsClient object to access its operations. - * - * @return the DevOpsPolicyAssignmentsClient object. - */ - public DevOpsPolicyAssignmentsClient getDevOpsPolicyAssignments() { - return this.devOpsPolicyAssignments; - } - - /** - * The GitHubOwnersClient object to access its operations. - */ - private final GitHubOwnersClient gitHubOwners; - - /** - * Gets the GitHubOwnersClient object to access its operations. - * - * @return the GitHubOwnersClient object. - */ - public GitHubOwnersClient getGitHubOwners() { - return this.gitHubOwners; - } - - /** - * The GitHubReposClient object to access its operations. - */ - private final GitHubReposClient gitHubRepos; - - /** - * Gets the GitHubReposClient object to access its operations. - * - * @return the GitHubReposClient object. - */ - public GitHubReposClient getGitHubRepos() { - return this.gitHubRepos; - } - - /** - * The GitLabGroupsClient object to access its operations. - */ - private final GitLabGroupsClient gitLabGroups; - - /** - * Gets the GitLabGroupsClient object to access its operations. - * - * @return the GitLabGroupsClient object. - */ - public GitLabGroupsClient getGitLabGroups() { - return this.gitLabGroups; - } - - /** - * The GitLabSubgroupsClient object to access its operations. - */ - private final GitLabSubgroupsClient gitLabSubgroups; - - /** - * Gets the GitLabSubgroupsClient object to access its operations. - * - * @return the GitLabSubgroupsClient object. - */ - public GitLabSubgroupsClient getGitLabSubgroups() { - return this.gitLabSubgroups; - } - - /** - * The GitLabProjectsClient object to access its operations. - */ - private final GitLabProjectsClient gitLabProjects; - - /** - * Gets the GitLabProjectsClient object to access its operations. - * - * @return the GitLabProjectsClient object. - */ - public GitLabProjectsClient getGitLabProjects() { - return this.gitLabProjects; - } - - /** - * The DevOpsOperationResultsClient object to access its operations. - */ - private final DevOpsOperationResultsClient devOpsOperationResults; - - /** - * Gets the DevOpsOperationResultsClient object to access its operations. - * - * @return the DevOpsOperationResultsClient object. - */ - public DevOpsOperationResultsClient getDevOpsOperationResults() { - return this.devOpsOperationResults; - } - /** * The ComplianceResultsClient object to access its operations. */ @@ -1220,51 +545,6 @@ public CustomRecommendationsClient getCustomRecommendations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.locations = new LocationsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.tasks = new TasksClientImpl(this); - this.autoProvisioningSettings = new AutoProvisioningSettingsClientImpl(this); - this.compliances = new CompliancesClientImpl(this); - this.informationProtectionPolicies = new InformationProtectionPoliciesClientImpl(this); - this.workspaceSettings = new WorkspaceSettingsClientImpl(this); - this.alertsSuppressionRules = new AlertsSuppressionRulesClientImpl(this); - this.regulatoryComplianceStandards = new RegulatoryComplianceStandardsClientImpl(this); - this.regulatoryComplianceControls = new RegulatoryComplianceControlsClientImpl(this); - this.regulatoryComplianceAssessments = new RegulatoryComplianceAssessmentsClientImpl(this); - this.subAssessments = new SubAssessmentsClientImpl(this); - this.connectors = new ConnectorsClientImpl(this); - this.softwareInventories = new SoftwareInventoriesClientImpl(this); - this.customAssessmentAutomations = new CustomAssessmentAutomationsClientImpl(this); - this.customEntityStoreAssignments = new CustomEntityStoreAssignmentsClientImpl(this); - this.mdeOnboardings = new MdeOnboardingsClientImpl(this); - this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); - this.governanceRules = new GovernanceRulesClientImpl(this); - this.applications = new ApplicationsClientImpl(this); - this.applicationOperations = new ApplicationOperationsClientImpl(this); - this.securityConnectorApplications = new SecurityConnectorApplicationsClientImpl(this); - this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsClientImpl(this); - this.defenderForStorages = new DefenderForStoragesClientImpl(this); - this.securityOperators = new SecurityOperatorsClientImpl(this); - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); - this.sensitivitySettings = new SensitivitySettingsClientImpl(this); - this.healthReports = new HealthReportsClientImpl(this); - this.automations = new AutomationsClientImpl(this); - this.securityContacts = new SecurityContactsClientImpl(this); - this.securityConnectors = new SecurityConnectorsClientImpl(this); - this.azureDevOpsOrgs = new AzureDevOpsOrgsClientImpl(this); - this.azureDevOpsProjects = new AzureDevOpsProjectsClientImpl(this); - this.azureDevOpsRepos = new AzureDevOpsReposClientImpl(this); - this.devOpsConfigurations = new DevOpsConfigurationsClientImpl(this); - this.devOpsPolicies = new DevOpsPoliciesClientImpl(this); - this.devOpsPolicyAssignments = new DevOpsPolicyAssignmentsClientImpl(this); - this.gitHubOwners = new GitHubOwnersClientImpl(this); - this.gitHubRepos = new GitHubReposClientImpl(this); - this.gitLabGroups = new GitLabGroupsClientImpl(this); - this.gitLabSubgroups = new GitLabSubgroupsClientImpl(this); - this.gitLabProjects = new GitLabProjectsClientImpl(this); - this.devOpsOperationResults = new DevOpsOperationResultsClientImpl(this); this.complianceResults = new ComplianceResultsClientImpl(this); this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); this.deviceSecurityGroups = new DeviceSecurityGroupsClientImpl(this); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java deleted file mode 100644 index 1cb19d0395135..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java +++ /dev/null @@ -1,533 +0,0 @@ -// Copyright (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.resourcemanager.security.fluent.SecurityConnectorApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorApplicationOperationsClient. - */ -public final class SecurityConnectorApplicationOperationsClientImpl - implements SecurityConnectorApplicationOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityConnectorApplicationOperationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorApplicationOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorApplicationOperationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecurityConnectorApplicationOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorApplicationOperations to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorApplicationOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @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, - @PathParam("applicationId") String applicationId, - @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @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, - @PathParam("applicationId") String applicationId, Context context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, applicationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, applicationId, accept, context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String applicationId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, applicationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, context).block(); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String resourceGroupName, String securityConnectorName, String applicationId) { - return getWithResponse(resourceGroupName, securityConnectorName, applicationId, Context.NONE).getValue(); - } - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId, ApplicationInner application) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, applicationId, application, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId, ApplicationInner application, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-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, applicationId, application, accept, context); - } - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, application, - context).block(); - } - - /** - * Creates or update a security Application on the given 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 applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate(String resourceGroupName, String securityConnectorName, String applicationId, - ApplicationInner application) { - return createOrUpdateWithResponse(resourceGroupName, securityConnectorName, applicationId, application, - Context.NONE).getValue(); - } - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String securityConnectorName, - String applicationId) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, applicationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String securityConnectorName, - String applicationId, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, applicationId, context); - } - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, String applicationId) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, applicationId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, context).block(); - } - - /** - * Delete an Application over a given scope. - * - * @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 applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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, String applicationId) { - deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java deleted file mode 100644 index ba0329b7dc542..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.SecurityConnectorApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.SecurityConnectorApplicationOperations; - -public final class SecurityConnectorApplicationOperationsImpl implements SecurityConnectorApplicationOperations { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorApplicationOperationsImpl.class); - - private final SecurityConnectorApplicationOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorApplicationOperationsImpl(SecurityConnectorApplicationOperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, applicationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Application get(String resourceGroupName, String securityConnectorName, String applicationId) { - ApplicationInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, applicationId); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, applicationId, application, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Application createOrUpdate(String resourceGroupName, String securityConnectorName, String applicationId, - ApplicationInner application) { - ApplicationInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, applicationId, application); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, context); - } - - public void delete(String resourceGroupName, String securityConnectorName, String applicationId) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, applicationId); - } - - private SecurityConnectorApplicationOperationsClient 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/SecurityConnectorApplicationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java deleted file mode 100644 index 7267a2deb624c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. - */ -public final class SecurityConnectorApplicationsClientImpl implements SecurityConnectorApplicationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityConnectorApplicationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorApplicationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecurityConnectorApplicationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorApplications to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorApplicationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@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); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security applications list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security applications list along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java deleted file mode 100644 index 655888a76d63d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.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.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.SecurityConnectorApplications; - -public final class SecurityConnectorApplicationsImpl implements SecurityConnectorApplications { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorApplicationsImpl.class); - - private final SecurityConnectorApplicationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorApplicationsImpl(SecurityConnectorApplicationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - private SecurityConnectorApplicationsClient 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/SecurityConnectorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java deleted file mode 100644 index 0329d2ef0f1e9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.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.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.EnvironmentData; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.time.OffsetDateTime; -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 OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.innerModel().hierarchyIdentifierTrialEndDate(); - } - - public CloudName environmentName() { - return this.innerModel().environmentName(); - } - - public List offerings() { - List inner = this.innerModel().offerings(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public EnvironmentData environmentData() { - return this.innerModel().environmentData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.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 withEnvironmentName(CloudName environmentName) { - this.innerModel().withEnvironmentName(environmentName); - return this; - } - - public SecurityConnectorImpl withOfferings(List offerings) { - this.innerModel().withOfferings(offerings); - return this; - } - - public SecurityConnectorImpl withEnvironmentData(EnvironmentData environmentData) { - this.innerModel().withEnvironmentData(environmentData); - 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 deleted file mode 100644 index 2f06f9c446996..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java +++ /dev/null @@ -1,1061 +0,0 @@ -// Copyright (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.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 { - /** - * 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") - public 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2024-08-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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2024-08-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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 = "2024-08-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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 = "2024-08-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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 = "2024-08-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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 = "2024-08-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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, - String securityConnectorName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 = "2024-08-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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 = "2024-08-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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String securityConnectorName, SecurityConnectorInner securityConnector, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, 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) - public SecurityConnectorInner createOrUpdate(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return createOrUpdateWithResponse(resourceGroupName, securityConnectorName, securityConnector, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 = "2024-08-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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 = "2024-08-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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector, Context context) { - return updateWithResponseAsync(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) - public SecurityConnectorInner update(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return updateWithResponse(resourceGroupName, securityConnectorName, securityConnector, Context.NONE).getValue(); - } - - /** - * 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-08-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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String securityConnectorName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-08-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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName).flatMap(ignored -> 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName) { - deleteWithResponse(resourceGroupName, securityConnectorName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} 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 deleted file mode 100644 index f2939bcf75f26..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.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.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; - -public final class SecurityConnectorsImpl implements SecurityConnectors { - private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - 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 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 deleteByResourceGroupWithResponse(String resourceGroupName, String securityConnectorName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, securityConnectorName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { - this.serviceClient().delete(resourceGroupName, securityConnectorName); - } - - public SecurityConnector getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.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.deleteByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = ResourceManagerUtils.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.deleteByResourceGroupWithResponse(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/SecurityContactImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java deleted file mode 100644 index 029aa75704013..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.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.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.NotificationsSource; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactName; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import java.util.Collections; -import java.util.List; - -public final class SecurityContactImpl implements SecurityContact, SecurityContact.Definition { - private SecurityContactInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityContactImpl(SecurityContactInner 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 emails() { - return this.innerModel().emails(); - } - - public String phone() { - return this.innerModel().phone(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public List notificationsSources() { - List inner = this.innerModel().notificationsSources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.innerModel().notificationsByRole(); - } - - public SecurityContactInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private SecurityContactName securityContactName; - - public SecurityContact create() { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityContact create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityContactImpl(SecurityContactName name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityContactInner(); - this.serviceManager = serviceManager; - this.securityContactName = name; - } - - public SecurityContact refresh() { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .getWithResponse(securityContactName, Context.NONE) - .getValue(); - return this; - } - - public SecurityContact refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .getWithResponse(securityContactName, context) - .getValue(); - return this; - } - - public SecurityContactImpl withEmails(String emails) { - this.innerModel().withEmails(emails); - return this; - } - - public SecurityContactImpl withPhone(String phone) { - this.innerModel().withPhone(phone); - return this; - } - - public SecurityContactImpl withIsEnabled(Boolean isEnabled) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } - - public SecurityContactImpl withNotificationsSources(List notificationsSources) { - this.innerModel().withNotificationsSources(notificationsSources); - return this; - } - - public SecurityContactImpl - withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { - this.innerModel().withNotificationsByRole(notificationsByRole); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java deleted file mode 100644 index be18912c5acb3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java +++ /dev/null @@ -1,617 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContactList; -import com.azure.resourcemanager.security.models.SecurityContactName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityContactsClient. - */ -public final class SecurityContactsClientImpl implements SecurityContactsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityContactsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityContactsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityContactsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecurityContactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityContacts to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityContactsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts") - @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/securityContacts/{securityContactName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") SecurityContactName securityContactName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") SecurityContactName securityContactName, - @BodyParam("application/json") SecurityContactInner securityContact, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") SecurityContactName securityContactName, - @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 all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-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 all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-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 all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SecurityContactName securityContactName) { - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - securityContactName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SecurityContactName securityContactName, - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), securityContactName, - accept, context); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(SecurityContactName securityContactName) { - return getWithResponseAsync(securityContactName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(SecurityContactName securityContactName, Context context) { - return getWithResponseAsync(securityContactName, context).block(); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner get(SecurityContactName securityContactName) { - return getWithResponse(securityContactName, Context.NONE).getValue(); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(SecurityContactName securityContactName, - SecurityContactInner securityContact) { - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - if (securityContact == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContact is required and cannot be null.")); - } else { - securityContact.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), securityContactName, securityContact, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(SecurityContactName securityContactName, - SecurityContactInner securityContact, 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - if (securityContact == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContact is required and cannot be null.")); - } else { - securityContact.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - securityContactName, securityContact, accept, context); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(SecurityContactName securityContactName, - SecurityContactInner securityContact) { - return createWithResponseAsync(securityContactName, securityContact) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(SecurityContactName securityContactName, - SecurityContactInner securityContact, Context context) { - return createWithResponseAsync(securityContactName, securityContact, context).block(); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner create(SecurityContactName securityContactName, SecurityContactInner securityContact) { - return createWithResponse(securityContactName, securityContact, Context.NONE).getValue(); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(SecurityContactName securityContactName) { - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), securityContactName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(SecurityContactName securityContactName, 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - securityContactName, accept, context); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(SecurityContactName securityContactName) { - return deleteWithResponseAsync(securityContactName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(SecurityContactName securityContactName, Context context) { - return deleteWithResponseAsync(securityContactName, context).block(); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(SecurityContactName securityContactName) { - deleteWithResponse(securityContactName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 contacts response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java deleted file mode 100644 index c0f936d77aada..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (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.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactName; -import com.azure.resourcemanager.security.models.SecurityContacts; - -public final class SecurityContactsImpl implements SecurityContacts { - private static final ClientLogger LOGGER = new ClientLogger(SecurityContactsImpl.class); - - private final SecurityContactsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityContactsImpl(SecurityContactsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); - } - - public Response getWithResponse(SecurityContactName securityContactName, Context context) { - Response inner = this.serviceClient().getWithResponse(securityContactName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityContactImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityContact get(SecurityContactName securityContactName) { - SecurityContactInner inner = this.serviceClient().get(securityContactName); - if (inner != null) { - return new SecurityContactImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(SecurityContactName securityContactName, Context context) { - return this.serviceClient().deleteWithResponse(securityContactName, context); - } - - public void delete(SecurityContactName securityContactName) { - this.serviceClient().delete(securityContactName); - } - - public SecurityContact getById(String id) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - return this.getWithResponse(securityContactName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - return this.getWithResponse(securityContactName, context); - } - - public void deleteById(String id) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - this.deleteWithResponse(securityContactName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - return this.deleteWithResponse(securityContactName, context); - } - - private SecurityContactsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityContactImpl define(SecurityContactName name) { - return new SecurityContactImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java deleted file mode 100644 index 8b47bb0038230..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.SecurityOperator; - -public final class SecurityOperatorImpl implements SecurityOperator { - private SecurityOperatorInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityOperatorImpl(SecurityOperatorInner 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 Identity identity() { - return this.innerModel().identity(); - } - - public SecurityOperatorInner 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/SecurityOperatorListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java deleted file mode 100644 index 2d7b6005ef576..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import com.azure.resourcemanager.security.models.SecurityOperator; -import com.azure.resourcemanager.security.models.SecurityOperatorList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class SecurityOperatorListImpl implements SecurityOperatorList { - private SecurityOperatorListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityOperatorListImpl(SecurityOperatorListInner 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 SecurityOperatorImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public SecurityOperatorListInner 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/SecurityOperatorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java deleted file mode 100644 index a21e42d065723..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java +++ /dev/null @@ -1,562 +0,0 @@ -// Copyright (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.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.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityOperatorsClient. - */ -public final class SecurityOperatorsClientImpl implements SecurityOperatorsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityOperatorsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityOperatorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityOperatorsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecurityOperatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityOperators to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityOperatorsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String pricingName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - pricingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String pricingName, 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, accept, - context); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String pricingName) { - return listWithResponseAsync(pricingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String pricingName, Context context) { - return listWithResponseAsync(pricingName, context).block(); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorListInner list(String pricingName) { - return listWithResponse(pricingName, Context.NONE).getValue(); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String pricingName, - String securityOperatorName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - pricingName, securityOperatorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String pricingName, String securityOperatorName, - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, - securityOperatorName, accept, context); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String pricingName, String securityOperatorName) { - return getWithResponseAsync(pricingName, securityOperatorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String pricingName, String securityOperatorName, - Context context) { - return getWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorInner get(String pricingName, String securityOperatorName) { - return getWithResponse(pricingName, securityOperatorName, Context.NONE).getValue(); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 operator under a given subscription and pricing along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String pricingName, - String securityOperatorName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), pricingName, securityOperatorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 operator under a given subscription and pricing along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String pricingName, - String securityOperatorName, 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - pricingName, securityOperatorName, accept, context); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 operator under a given subscription and pricing on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String pricingName, String securityOperatorName) { - return createOrUpdateWithResponseAsync(pricingName, securityOperatorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 operator under a given subscription and pricing along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, - Context context) { - return createOrUpdateWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 operator under a given subscription and pricing. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorInner createOrUpdate(String pricingName, String securityOperatorName) { - return createOrUpdateWithResponse(pricingName, securityOperatorName, Context.NONE).getValue(); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String pricingName, String securityOperatorName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), pricingName, securityOperatorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String pricingName, String securityOperatorName, - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, - securityOperatorName, accept, context); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String pricingName, String securityOperatorName) { - return deleteWithResponseAsync(pricingName, securityOperatorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String pricingName, String securityOperatorName, Context context) { - return deleteWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 pricingName, String securityOperatorName) { - deleteWithResponse(pricingName, securityOperatorName, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java deleted file mode 100644 index e5d70025bc582..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (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.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import com.azure.resourcemanager.security.models.SecurityOperator; -import com.azure.resourcemanager.security.models.SecurityOperatorList; -import com.azure.resourcemanager.security.models.SecurityOperators; - -public final class SecurityOperatorsImpl implements SecurityOperators { - private static final ClientLogger LOGGER = new ClientLogger(SecurityOperatorsImpl.class); - - private final SecurityOperatorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityOperatorsImpl(SecurityOperatorsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String pricingName, Context context) { - Response inner = this.serviceClient().listWithResponse(pricingName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityOperatorListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityOperatorList list(String pricingName) { - SecurityOperatorListInner inner = this.serviceClient().list(pricingName); - if (inner != null) { - return new SecurityOperatorListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String pricingName, String securityOperatorName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(pricingName, securityOperatorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityOperatorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityOperator get(String pricingName, String securityOperatorName) { - SecurityOperatorInner inner = this.serviceClient().get(pricingName, securityOperatorName); - if (inner != null) { - return new SecurityOperatorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, - Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(pricingName, securityOperatorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityOperatorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityOperator createOrUpdate(String pricingName, String securityOperatorName) { - SecurityOperatorInner inner = this.serviceClient().createOrUpdate(pricingName, securityOperatorName); - if (inner != null) { - return new SecurityOperatorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String pricingName, String securityOperatorName, - Context context) { - return this.serviceClient().deleteWithResponse(pricingName, securityOperatorName, context); - } - - public void deleteByResourceGroup(String pricingName, String securityOperatorName) { - this.serviceClient().delete(pricingName, securityOperatorName); - } - - private SecurityOperatorsClient 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/SecuritySubAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java deleted file mode 100644 index b3497d8c02b1c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.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.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecuritySubAssessment; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.time.OffsetDateTime; - -public final class SecuritySubAssessmentImpl implements SecuritySubAssessment { - private SecuritySubAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySubAssessmentImpl(SecuritySubAssessmentInner 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 idPropertiesId() { - return this.innerModel().idPropertiesId(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public SubAssessmentStatus status() { - return this.innerModel().status(); - } - - public String remediation() { - return this.innerModel().remediation(); - } - - public String impact() { - return this.innerModel().impact(); - } - - public String category() { - return this.innerModel().category(); - } - - public String description() { - return this.innerModel().description(); - } - - public OffsetDateTime timeGenerated() { - return this.innerModel().timeGenerated(); - } - - public ResourceDetails resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public AdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public SecuritySubAssessmentInner 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/SecurityTaskImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java deleted file mode 100644 index 6d71c09739a1d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTask; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.time.OffsetDateTime; - -public final class SecurityTaskImpl implements SecurityTask { - private SecurityTaskInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityTaskImpl(SecurityTaskInner 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 state() { - return this.innerModel().state(); - } - - public OffsetDateTime creationTimeUtc() { - return this.innerModel().creationTimeUtc(); - } - - public SecurityTaskParameters securityTaskParameters() { - return this.innerModel().securityTaskParameters(); - } - - public OffsetDateTime lastStateChangeTimeUtc() { - return this.innerModel().lastStateChangeTimeUtc(); - } - - public String subState() { - return this.innerModel().subState(); - } - - public SecurityTaskInner 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/SensitivitySettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java deleted file mode 100644 index b4901fc00e763..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SensitivitySettingsClient. - */ -public final class SensitivitySettingsClientImpl implements SensitivitySettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SensitivitySettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SensitivitySettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensitivitySettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SensitivitySettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSensitivitySettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSensit") - public interface SensitivitySettingsService { - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Security/sensitivitySettings/current") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateSensitivitySettingsRequest sensitivitySettings, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/sensitivitySettings/current") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/sensitivitySettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - createOrUpdateWithResponseAsync(UpdateSensitivitySettingsRequest sensitivitySettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sensitivitySettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); - } else { - sensitivitySettings.validate(); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, sensitivitySettings, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - createOrUpdateWithResponseAsync(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sensitivitySettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); - } else { - sensitivitySettings.validate(); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, sensitivitySettings, accept, context); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - createOrUpdateAsync(UpdateSensitivitySettingsRequest sensitivitySettings) { - return createOrUpdateWithResponseAsync(sensitivitySettings).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - createOrUpdateWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { - return createOrUpdateWithResponseAsync(sensitivitySettings, context).block(); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetSensitivitySettingsResponseInner createOrUpdate(UpdateSensitivitySettingsRequest sensitivitySettings) { - return createOrUpdateWithResponse(sensitivitySettings, Context.NONE).getValue(); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetSensitivitySettingsResponseInner get() { - return getWithResponse(Context.NONE).getValue(); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list with a single sensitivity settings resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetSensitivitySettingsListResponseInner list() { - return listWithResponse(Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java deleted file mode 100644 index 2b77f8d613770..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.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.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; -import com.azure.resourcemanager.security.models.SensitivitySettings; -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; - -public final class SensitivitySettingsImpl implements SensitivitySettings { - private static final ClientLogger LOGGER = new ClientLogger(SensitivitySettingsImpl.class); - - private final SensitivitySettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SensitivitySettingsImpl(SensitivitySettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response - createOrUpdateWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(sensitivitySettings, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GetSensitivitySettingsResponse createOrUpdate(UpdateSensitivitySettingsRequest sensitivitySettings) { - GetSensitivitySettingsResponseInner inner = this.serviceClient().createOrUpdate(sensitivitySettings); - if (inner != null) { - return new GetSensitivitySettingsResponseImpl(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 GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GetSensitivitySettingsResponse get() { - GetSensitivitySettingsResponseInner inner = this.serviceClient().get(); - if (inner != null) { - return new GetSensitivitySettingsResponseImpl(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 GetSensitivitySettingsListResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GetSensitivitySettingsListResponse list() { - GetSensitivitySettingsListResponseInner inner = this.serviceClient().list(); - if (inner != null) { - return new GetSensitivitySettingsListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private SensitivitySettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java index d9573c7f236d3..c2b395c38c0e7 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 @@ -29,7 +29,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.security.fluent.SettingsClient; import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; +import com.azure.resourcemanager.security.models.SettingName; import com.azure.resourcemanager.security.models.SettingsList; import reactor.core.publisher.Mono; @@ -78,8 +78,7 @@ Mono> list(@HostParam("$host") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingNameAutoGenerated settingName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("settingName") SettingName settingName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}") @@ -87,8 +86,8 @@ Mono> get(@HostParam("$host") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> update(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingNameAutoGenerated settingName, - @BodyParam("application/json") SettingInner setting, @HeaderParam("Accept") String accept, Context context); + @PathParam("settingName") SettingName settingName, @BodyParam("application/json") SettingInner setting, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -215,7 +214,7 @@ public PagedIterable list(Context context) { * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SettingNameAutoGenerated settingName) { + private Mono> getWithResponseAsync(SettingName settingName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -246,7 +245,7 @@ private Mono> getWithResponseAsync(SettingNameAutoGenerat * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SettingNameAutoGenerated settingName, Context context) { + private Mono> getWithResponseAsync(SettingName settingName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -275,7 +274,7 @@ private Mono> getWithResponseAsync(SettingNameAutoGenerat * @return the kind of the security setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(SettingNameAutoGenerated settingName) { + private Mono getAsync(SettingName settingName) { return getWithResponseAsync(settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -290,7 +289,7 @@ private Mono getAsync(SettingNameAutoGenerated settingName) { * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(SettingNameAutoGenerated settingName, Context context) { + public Response getWithResponse(SettingName settingName, Context context) { return getWithResponseAsync(settingName, context).block(); } @@ -304,7 +303,7 @@ public Response getWithResponse(SettingNameAutoGenerated settingNa * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner get(SettingNameAutoGenerated settingName) { + public SettingInner get(SettingName settingName) { return getWithResponse(settingName, Context.NONE).getValue(); } @@ -319,8 +318,7 @@ public SettingInner get(SettingNameAutoGenerated settingName) { * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(SettingNameAutoGenerated settingName, - SettingInner setting) { + private Mono> updateWithResponseAsync(SettingName settingName, SettingInner setting) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -357,8 +355,8 @@ private Mono> updateWithResponseAsync(SettingNameAutoGene * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(SettingNameAutoGenerated settingName, - SettingInner setting, Context context) { + private Mono> updateWithResponseAsync(SettingName settingName, SettingInner setting, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -393,7 +391,7 @@ private Mono> updateWithResponseAsync(SettingNameAutoGene * @return the kind of the security setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(SettingNameAutoGenerated settingName, SettingInner setting) { + private Mono updateAsync(SettingName settingName, SettingInner setting) { return updateWithResponseAsync(settingName, setting).flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -409,8 +407,7 @@ private Mono updateAsync(SettingNameAutoGenerated settingName, Set * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(SettingNameAutoGenerated settingName, SettingInner setting, - Context context) { + public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { return updateWithResponseAsync(settingName, setting, context).block(); } @@ -425,7 +422,7 @@ public Response updateWithResponse(SettingNameAutoGenerated settin * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner update(SettingNameAutoGenerated settingName, SettingInner setting) { + public SettingInner update(SettingName settingName, SettingInner setting) { return updateWithResponse(settingName, setting, Context.NONE).getValue(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java index 41288aa70b220..720d3730dd63a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java @@ -12,7 +12,7 @@ import com.azure.resourcemanager.security.fluent.SettingsClient; import com.azure.resourcemanager.security.fluent.models.SettingInner; import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; +import com.azure.resourcemanager.security.models.SettingName; import com.azure.resourcemanager.security.models.Settings; public final class SettingsImpl implements Settings { @@ -37,7 +37,7 @@ public PagedIterable list(Context context) { return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); } - public Response getWithResponse(SettingNameAutoGenerated settingName, Context context) { + public Response getWithResponse(SettingName settingName, Context context) { Response inner = this.serviceClient().getWithResponse(settingName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), @@ -47,7 +47,7 @@ public Response getWithResponse(SettingNameAutoGenerated settingName, C } } - public Setting get(SettingNameAutoGenerated settingName) { + public Setting get(SettingName settingName) { SettingInner inner = this.serviceClient().get(settingName); if (inner != null) { return new SettingImpl(inner, this.manager()); @@ -56,8 +56,7 @@ public Setting get(SettingNameAutoGenerated settingName) { } } - public Response updateWithResponse(SettingNameAutoGenerated settingName, SettingInner setting, - Context context) { + public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { Response inner = this.serviceClient().updateWithResponse(settingName, setting, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), @@ -67,7 +66,7 @@ public Response updateWithResponse(SettingNameAutoGenerated settingName } } - public Setting update(SettingNameAutoGenerated settingName, SettingInner setting) { + public Setting update(SettingName settingName, SettingInner setting) { SettingInner inner = this.serviceClient().update(settingName, setting); if (inner != null) { return new SettingImpl(inner, this.manager()); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareImpl.java deleted file mode 100644 index 53f34853574ed..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; - -public final class SoftwareImpl implements Software { - private SoftwareInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SoftwareImpl(SoftwareInner 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 osPlatform() { - return this.innerModel().osPlatform(); - } - - public String vendor() { - return this.innerModel().vendor(); - } - - public String softwareName() { - return this.innerModel().softwareName(); - } - - public String version() { - return this.innerModel().version(); - } - - public EndOfSupportStatus endOfSupportStatus() { - return this.innerModel().endOfSupportStatus(); - } - - public String endOfSupportDate() { - return this.innerModel().endOfSupportDate(); - } - - public Integer numberOfKnownVulnerabilities() { - return this.innerModel().numberOfKnownVulnerabilities(); - } - - public String firstSeenAt() { - return this.innerModel().firstSeenAt(); - } - - public SoftwareInner 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/SoftwareInventoriesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java deleted file mode 100644 index c445b9d9f37b4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java +++ /dev/null @@ -1,686 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.SoftwaresList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. - */ -public final class SoftwareInventoriesClientImpl implements SoftwareInventoriesClient { - /** - * The proxy service used to perform REST calls. - */ - private final SoftwareInventoriesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SoftwareInventoriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SoftwareInventoriesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SoftwareInventoriesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSoftwareInventories to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSoftwa") - public interface SoftwareInventoriesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, @PathParam("softwareName") String softwareName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResourceNext( - @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 the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name 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 the software inventory of the virtual machine along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceNamespace, resourceType, resourceName, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceNamespace, resourceType, resourceName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name 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 the software inventory of the virtual machine as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - return new PagedFlux<>(() -> listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, - resourceType, resourceName), nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context) { - return new PagedFlux<>(() -> listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, - resourceType, resourceName, context), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name 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 the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - return new PagedIterable<>( - listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context) { - return new PagedIterable<>( - listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 software data of the virtual machine along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, String softwareName) { - 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (softwareName == null) { - return Mono.error(new IllegalArgumentException("Parameter softwareName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceNamespace, resourceType, resourceName, softwareName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 software data of the virtual machine along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, String softwareName, 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (softwareName == null) { - return Mono.error(new IllegalArgumentException("Parameter softwareName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceNamespace, resourceType, resourceName, softwareName, apiVersion, accept, context); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 software data of the virtual machine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName, String softwareName) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 software data of the virtual machine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, String softwareName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, - context).block(); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 software data of the virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SoftwareInner get(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName, String softwareName) { - return getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, - Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync(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.listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync(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.listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java deleted file mode 100644 index 277f1a9302d08..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.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.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.SoftwareInventoriesClient; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.Software; -import com.azure.resourcemanager.security.models.SoftwareInventories; - -public final class SoftwareInventoriesImpl implements SoftwareInventories { - private static final ClientLogger LOGGER = new ClientLogger(SoftwareInventoriesImpl.class); - - private final SoftwareInventoriesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SoftwareInventoriesImpl(SoftwareInventoriesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - PagedIterable inner = this.serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context) { - PagedIterable inner = this.serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName, String softwareName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SoftwareImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Software get(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, - String softwareName) { - SoftwareInner inner - = this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName); - if (inner != null) { - return new SoftwareImpl(inner, this.manager()); - } else { - return null; - } - } - - private SoftwareInventoriesClient 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/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java deleted file mode 100644 index e6758e2a84512..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright (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.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentBaselineRulesClient. - */ -public final class SqlVulnerabilityAssessmentBaselineRulesClientImpl - implements SqlVulnerabilityAssessmentBaselineRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentBaselineRulesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentBaselineRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentBaselineRulesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentBaselineRulesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentBaselineRules to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSqlVul") - public interface SqlVulnerabilityAssessmentBaselineRulesService { - @Headers({ "Content-Type: application/json" }) - @Put("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @BodyParam("application/json") RuleResultsInput body, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> add(@HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @BodyParam("application/json") RulesResultsInput body, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String ruleId, String workspaceId, - String resourceId, RuleResultsInput body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, - resourceId, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String ruleId, String workspaceId, - String resourceId, RuleResultsInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, body, - accept, context); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 rule results on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String ruleId, String workspaceId, String resourceId) { - final RuleResultsInput body = null; - return createOrUpdateWithResponseAsync(ruleId, workspaceId, resourceId, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String ruleId, String workspaceId, String resourceId, - RuleResultsInput body, Context context) { - return createOrUpdateWithResponseAsync(ruleId, workspaceId, resourceId, body, context).block(); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 rule results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RuleResultsInner createOrUpdate(String ruleId, String workspaceId, String resourceId) { - final RuleResultsInput body = null; - return createOrUpdateWithResponse(ruleId, workspaceId, resourceId, body, Context.NONE).getValue(); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 the results for a given rule in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ruleId, String workspaceId, - String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ruleId, String workspaceId, String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 the results for a given rule in the Baseline on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ruleId, String workspaceId, String resourceId) { - return getWithResponseAsync(ruleId, workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ruleId, String workspaceId, String resourceId, - Context context) { - return getWithResponseAsync(ruleId, workspaceId, resourceId, context).block(); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 the results for a given rule in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RuleResultsInner get(String ruleId, String workspaceId, String resourceId) { - return getWithResponse(ruleId, workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ruleId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, - resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ruleId, String workspaceId, String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String ruleId, String workspaceId, String resourceId) { - return deleteWithResponseAsync(ruleId, workspaceId, resourceId).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context) { - return deleteWithResponseAsync(ruleId, workspaceId, resourceId, context).block(); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String ruleId, String workspaceId, String resourceId) { - deleteWithResponse(ruleId, workspaceId, resourceId, Context.NONE); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @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 the results for all rules in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @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 the results for all rules in the Baseline on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String workspaceId, String resourceId) { - return listWithResponseAsync(workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - return listWithResponseAsync(workspaceId, resourceId, context).block(); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @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 the results for all rules in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RulesResultsInner list(String workspaceId, String resourceId) { - return listWithResponse(workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 rules results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync(String workspaceId, String resourceId, - RulesResultsInput body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 rules results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync(String workspaceId, String resourceId, - RulesResultsInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, accept, context); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @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 a list of rules results on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono addAsync(String workspaceId, String resourceId) { - final RulesResultsInput body = null; - return addWithResponseAsync(workspaceId, resourceId, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 rules results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addWithResponse(String workspaceId, String resourceId, RulesResultsInput body, - Context context) { - return addWithResponseAsync(workspaceId, resourceId, body, context).block(); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @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 a list of rules results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RulesResultsInner add(String workspaceId, String resourceId) { - final RulesResultsInput body = null; - return addWithResponse(workspaceId, resourceId, body, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java deleted file mode 100644 index 350e1af599c10..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (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.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RulesResults; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; - -public final class SqlVulnerabilityAssessmentBaselineRulesImpl implements SqlVulnerabilityAssessmentBaselineRules { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentBaselineRulesImpl.class); - - private final SqlVulnerabilityAssessmentBaselineRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentBaselineRulesImpl(SqlVulnerabilityAssessmentBaselineRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String ruleId, String workspaceId, String resourceId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(ruleId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RuleResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RuleResults get(String ruleId, String workspaceId, String resourceId) { - RuleResultsInner inner = this.serviceClient().get(ruleId, workspaceId, resourceId); - if (inner != null) { - return new RuleResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context) { - return this.serviceClient().deleteWithResponse(ruleId, workspaceId, resourceId, context); - } - - public void delete(String ruleId, String workspaceId, String resourceId) { - this.serviceClient().delete(ruleId, workspaceId, resourceId); - } - - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - Response inner = this.serviceClient().listWithResponse(workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RulesResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RulesResults list(String workspaceId, String resourceId) { - RulesResultsInner inner = this.serviceClient().list(workspaceId, resourceId); - if (inner != null) { - return new RulesResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response addWithResponse(String workspaceId, String resourceId, RulesResultsInput body, - Context context) { - Response inner - = this.serviceClient().addWithResponse(workspaceId, resourceId, body, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RulesResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RulesResults add(String workspaceId, String resourceId) { - RulesResultsInner inner = this.serviceClient().add(workspaceId, resourceId); - if (inner != null) { - return new RulesResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlVulnerabilityAssessmentBaselineRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public RuleResultsImpl define(String name) { - return new RuleResultsImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java deleted file mode 100644 index e1a3a01893ace..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentScanResultsClient. - */ -public final class SqlVulnerabilityAssessmentScanResultsClientImpl - implements SqlVulnerabilityAssessmentScanResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentScanResultsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentScanResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentScanResultsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentScanResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScanResults to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSqlVul") - public interface SqlVulnerabilityAssessmentScanResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("scanId") String scanId, - @PathParam("scanResultId") String scanResultId, @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, @PathParam("scanId") String scanId, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @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 the scan results of a single rule in a scan record along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String scanResultId, String workspaceId, - String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (scanResultId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanResultId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), scanId, scanResultId, workspaceId, - apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String scanResultId, String workspaceId, - String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (scanResultId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanResultId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), scanId, scanResultId, workspaceId, apiVersion, resourceId, accept, - context); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @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 the scan results of a single rule in a scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scanId, String scanResultId, String workspaceId, String resourceId) { - return getWithResponseAsync(scanId, scanResultId, workspaceId, resourceId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scanId, String scanResultId, String workspaceId, - String resourceId, Context context) { - return getWithResponseAsync(scanId, scanResultId, workspaceId, resourceId, context).block(); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @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 the scan results of a single rule in a scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanResultInner get(String scanId, String scanResultId, String workspaceId, String resourceId) { - return getWithResponse(scanId, scanResultId, workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @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 a list of scan results for a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scanId, String workspaceId, - String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scanId, String workspaceId, String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @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 a list of scan results for a single scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scanId, String workspaceId, String resourceId) { - return listWithResponseAsync(scanId, workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scanId, String workspaceId, String resourceId, - Context context) { - return listWithResponseAsync(scanId, workspaceId, resourceId, context).block(); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @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 a list of scan results for a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanResultsInner list(String scanId, String workspaceId, String resourceId) { - return listWithResponse(scanId, workspaceId, resourceId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java deleted file mode 100644 index ac44a1c6049b8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.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.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.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResults; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; - -public final class SqlVulnerabilityAssessmentScanResultsImpl implements SqlVulnerabilityAssessmentScanResults { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentScanResultsImpl.class); - - private final SqlVulnerabilityAssessmentScanResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentScanResultsImpl(SqlVulnerabilityAssessmentScanResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scanId, String scanResultId, String workspaceId, - String resourceId, Context context) { - Response inner - = this.serviceClient().getWithResponse(scanId, scanResultId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScanResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ScanResult get(String scanId, String scanResultId, String workspaceId, String resourceId) { - ScanResultInner inner = this.serviceClient().get(scanId, scanResultId, workspaceId, resourceId); - if (inner != null) { - return new ScanResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String scanId, String workspaceId, String resourceId, - Context context) { - Response inner - = this.serviceClient().listWithResponse(scanId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScanResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ScanResults list(String scanId, String workspaceId, String resourceId) { - ScanResultsInner inner = this.serviceClient().list(scanId, workspaceId, resourceId); - if (inner != null) { - return new ScanResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlVulnerabilityAssessmentScanResultsClient 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/SqlVulnerabilityAssessmentScansClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java deleted file mode 100644 index 4a12d5bb85464..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. - */ -public final class SqlVulnerabilityAssessmentScansClientImpl implements SqlVulnerabilityAssessmentScansClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentScansService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentScansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentScansClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentScansService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScans to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSqlVul") - public interface SqlVulnerabilityAssessmentScansService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("scanId") String scanId, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @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 the scan details of a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String workspaceId, String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @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 the scan details of a single scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scanId, String workspaceId, String resourceId) { - return getWithResponseAsync(scanId, workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context) { - return getWithResponseAsync(scanId, workspaceId, resourceId, context).block(); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @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 the scan details of a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanInner get(String scanId, String workspaceId, String resourceId) { - return getWithResponse(scanId, workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @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 a list of scan records along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId 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 = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @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 a list of scan records on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String workspaceId, String resourceId) { - return listWithResponseAsync(workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - return listWithResponseAsync(workspaceId, resourceId, context).block(); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @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 a list of scan records. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScansInner list(String workspaceId, String resourceId) { - return listWithResponse(workspaceId, resourceId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java deleted file mode 100644 index a5c3bb15481a1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.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.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.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.Scans; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; - -public final class SqlVulnerabilityAssessmentScansImpl implements SqlVulnerabilityAssessmentScans { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentScansImpl.class); - - private final SqlVulnerabilityAssessmentScansClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentScansImpl(SqlVulnerabilityAssessmentScansClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context) { - Response inner = this.serviceClient().getWithResponse(scanId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScanImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Scan get(String scanId, String workspaceId, String resourceId) { - ScanInner inner = this.serviceClient().get(scanId, workspaceId, resourceId); - if (inner != null) { - return new ScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - Response inner = this.serviceClient().listWithResponse(workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScansImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Scans list(String workspaceId, String resourceId) { - ScansInner inner = this.serviceClient().list(workspaceId, resourceId); - if (inner != null) { - return new ScansImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlVulnerabilityAssessmentScansClient 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/SubAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java deleted file mode 100644 index 5e45aa84b1259..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java +++ /dev/null @@ -1,610 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.SecuritySubAssessmentList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SubAssessmentsClient. - */ -public final class SubAssessmentsClientImpl implements SubAssessmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SubAssessmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SubAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubAssessmentsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SubAssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSubAssessments to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSubAss") - public interface SubAssessmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/subAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll(@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/assessments/{assessmentName}/subAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("subAssessmentName") String subAssessmentName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 sub-assessments on all your scanned resources inside a subscription scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(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 = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAll(this.client.getEndpoint(), apiVersion, scope, 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 security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 sub-assessments on all your scanned resources inside a subscription scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(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 = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAll(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String scope) { - return new PagedFlux<>(() -> listAllSinglePageAsync(scope), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String scope, Context context) { - return new PagedFlux<>(() -> listAllSinglePageAsync(scope, context), - nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(String scope) { - return new PagedIterable<>(listAllAsync(scope)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(String scope, Context context) { - return new PagedIterable<>(listAllAsync(scope, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, 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 security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName, - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName) { - return new PagedIterable<>(listAsync(scope, assessmentName)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName, Context context) { - return new PagedIterable<>(listAsync(scope, assessmentName, context)); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String subAssessmentName) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (subAssessmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, - subAssessmentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String subAssessmentName, 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (subAssessmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, subAssessmentName, accept, - context); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String assessmentName, String subAssessmentName) { - return getWithResponseAsync(scope, assessmentName, subAssessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String assessmentName, - String subAssessmentName, Context context) { - return getWithResponseAsync(scope, assessmentName, subAssessmentName, context).block(); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySubAssessmentInner get(String scope, String assessmentName, String subAssessmentName) { - return getWithResponse(scope, assessmentName, subAssessmentName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security sub-assessments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(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.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 sub-assessments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(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.listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 sub-assessments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 sub-assessments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java deleted file mode 100644 index 65469f631ba75..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.SecuritySubAssessment; -import com.azure.resourcemanager.security.models.SubAssessments; - -public final class SubAssessmentsImpl implements SubAssessments { - private static final ClientLogger LOGGER = new ClientLogger(SubAssessmentsImpl.class); - - private final SubAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SubAssessmentsImpl(SubAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listAll(String scope) { - PagedIterable inner = this.serviceClient().listAll(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable listAll(String scope, Context context) { - PagedIterable inner = this.serviceClient().listAll(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String scope, String assessmentName, - String subAssessmentName, Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, assessmentName, subAssessmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecuritySubAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecuritySubAssessment get(String scope, String assessmentName, String subAssessmentName) { - SecuritySubAssessmentInner inner = this.serviceClient().get(scope, assessmentName, subAssessmentName); - if (inner != null) { - return new SecuritySubAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - private SubAssessmentsClient 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/TasksClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java deleted file mode 100644 index 50e2ff3026281..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java +++ /dev/null @@ -1,1358 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTaskList; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in TasksClient. - */ -public final class TasksClientImpl implements TasksClient { - /** - * The proxy service used to perform REST calls. - */ - private final TasksService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of TasksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TasksClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterTasks to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterTasks") - public interface TasksService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevelTask(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelTaskState(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("taskName") String taskName, - @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getResourceGroupLevelTask(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelTaskState(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, - @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, - @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> listByHomeRegionNext( - @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); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, String filter) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, filter), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - final String filter = null; - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, filter), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, String filter, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, filter, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - final String filter = null; - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, String filter, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync(String ascLocation, - String taskName) { - 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSubscriptionLevelTask(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, taskName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync(String ascLocation, - String taskName, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getSubscriptionLevelTask(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, taskName, accept, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getSubscriptionLevelTaskAsync(String ascLocation, String taskName) { - return getSubscriptionLevelTaskWithResponseAsync(ascLocation, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, - Context context) { - return getSubscriptionLevelTaskWithResponseAsync(ascLocation, taskName, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String taskName) { - return getSubscriptionLevelTaskWithResponse(ascLocation, taskName, Context.NONE).getValue(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelTaskStateWithResponseAsync(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateSubscriptionLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, taskName, taskUpdateActionType, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelTaskStateWithResponseAsync(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateSubscriptionLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, taskName, taskUpdateActionType, accept, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSubscriptionLevelTaskStateAsync(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - return updateSubscriptionLevelTaskStateWithResponseAsync(ascLocation, taskName, taskUpdateActionType) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelTaskStateWithResponse(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context) { - return updateSubscriptionLevelTaskStateWithResponseAsync(ascLocation, taskName, taskUpdateActionType, context) - .block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateSubscriptionLevelTaskState(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, Context.NONE); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String ascLocation, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String ascLocation, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation, - String filter) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation) { - final String filter = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation, - String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, ascLocation, filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation, - String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, ascLocation, filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName) { - 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getResourceGroupLevelTask(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getResourceGroupLevelTask(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, taskName, accept, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getResourceGroupLevelTaskAsync(String resourceGroupName, String ascLocation, - String taskName) { - return getResourceGroupLevelTaskWithResponseAsync(resourceGroupName, ascLocation, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, - String ascLocation, String taskName, Context context) { - return getResourceGroupLevelTaskWithResponseAsync(resourceGroupName, ascLocation, taskName, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a 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 security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - return getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, Context.NONE).getValue(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelTaskStateWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateResourceGroupLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, taskUpdateActionType, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelTaskStateWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateResourceGroupLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, taskUpdateActionType, accept, - context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateResourceGroupLevelTaskStateAsync(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType) { - return updateResourceGroupLevelTaskStateWithResponseAsync(resourceGroupName, ascLocation, taskName, - taskUpdateActionType).flatMap(ignored -> Mono.empty()); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateResourceGroupLevelTaskStateWithResponse(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return updateResourceGroupLevelTaskStateWithResponseAsync(resourceGroupName, ascLocation, taskName, - taskUpdateActionType, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - updateResourceGroupLevelTaskStateWithResponse(resourceGroupName, ascLocation, taskName, taskUpdateActionType, - Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(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.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(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.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java deleted file mode 100644 index 45ea2b27801a4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.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.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.TasksClient; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTask; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import com.azure.resourcemanager.security.models.Tasks; - -public final class TasksImpl implements Tasks { - private static final ClientLogger LOGGER = new ClientLogger(TasksImpl.class); - - private final TasksClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public TasksImpl(TasksClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, String filter, Context context) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, - Context context) { - Response inner - = this.serviceClient().getSubscriptionLevelTaskWithResponse(ascLocation, taskName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityTaskImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityTask getSubscriptionLevelTask(String ascLocation, String taskName) { - SecurityTaskInner inner = this.serviceClient().getSubscriptionLevelTask(ascLocation, taskName); - if (inner != null) { - return new SecurityTaskImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateSubscriptionLevelTaskStateWithResponse(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context) { - return this.serviceClient() - .updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, context); - } - - public void updateSubscriptionLevelTaskState(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - this.serviceClient().updateSubscriptionLevelTaskState(ascLocation, taskName, taskUpdateActionType); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, String ascLocation, - String taskName, Context context) { - Response inner = this.serviceClient() - .getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityTaskImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityTask getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - SecurityTaskInner inner - = this.serviceClient().getResourceGroupLevelTask(resourceGroupName, ascLocation, taskName); - if (inner != null) { - return new SecurityTaskImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateResourceGroupLevelTaskStateWithResponse(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return this.serviceClient() - .updateResourceGroupLevelTaskStateWithResponse(resourceGroupName, ascLocation, taskName, - taskUpdateActionType, context); - } - - public void updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - this.serviceClient() - .updateResourceGroupLevelTaskState(resourceGroupName, ascLocation, taskName, taskUpdateActionType); - } - - private TasksClient 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/WorkspaceSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java deleted file mode 100644 index 3b0eedc504272..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSetting; - -public final class WorkspaceSettingImpl - implements WorkspaceSetting, WorkspaceSetting.Definition, WorkspaceSetting.Update { - private WorkspaceSettingInner 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 workspaceId() { - return this.innerModel().workspaceId(); - } - - public String scope() { - return this.innerModel().scope(); - } - - public WorkspaceSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String workspaceSettingName; - - public WorkspaceSetting create() { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - WorkspaceSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new WorkspaceSettingInner(); - this.serviceManager = serviceManager; - this.workspaceSettingName = name; - } - - public WorkspaceSettingImpl update() { - return this; - } - - public WorkspaceSetting apply() { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - WorkspaceSettingImpl(WorkspaceSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceSettings"); - } - - public WorkspaceSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, context) - .getValue(); - return this; - } - - public WorkspaceSettingImpl withWorkspaceId(String workspaceId) { - this.innerModel().withWorkspaceId(workspaceId); - return this; - } - - public WorkspaceSettingImpl withScope(String scope) { - this.innerModel().withScope(scope); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java deleted file mode 100644 index 744ead6e09f3d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java +++ /dev/null @@ -1,767 +0,0 @@ -// Copyright (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.resourcemanager.security.fluent.WorkspaceSettingsClient; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSettingList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. - */ -public final class WorkspaceSettingsClientImpl implements WorkspaceSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final WorkspaceSettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of WorkspaceSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WorkspaceSettingsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(WorkspaceSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterWorkspaceSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterWorksp") - public interface WorkspaceSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings") - @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/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-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())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-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)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String workspaceSettingName) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String workspaceSettingName, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), workspaceSettingName, - accept, context); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String workspaceSettingName) { - return getWithResponseAsync(workspaceSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String workspaceSettingName, Context context) { - return getWithResponseAsync(workspaceSettingName, context).block(); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner get(String workspaceSettingName) { - return getWithResponse(workspaceSettingName, Context.NONE).getValue(); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), workspaceSettingName, workspaceSetting, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, workspaceSetting, accept, context); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - return createWithResponseAsync(workspaceSettingName, workspaceSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context) { - return createWithResponseAsync(workspaceSettingName, workspaceSetting, context).block(); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return createWithResponse(workspaceSettingName, workspaceSetting, Context.NONE).getValue(); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), workspaceSettingName, workspaceSetting, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, workspaceSetting, accept, context); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - return updateWithResponseAsync(workspaceSettingName, workspaceSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context) { - return updateWithResponseAsync(workspaceSettingName, workspaceSetting, context).block(); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return updateWithResponse(workspaceSettingName, workspaceSetting, Context.NONE).getValue(); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String workspaceSettingName) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), workspaceSettingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String workspaceSettingName, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, accept, context); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String workspaceSettingName) { - return deleteWithResponseAsync(workspaceSettingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String workspaceSettingName, Context context) { - return deleteWithResponseAsync(workspaceSettingName, context).block(); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String workspaceSettingName) { - deleteWithResponse(workspaceSettingName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java deleted file mode 100644 index 766cb1dcc73ec..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.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.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.WorkspaceSettingsClient; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import com.azure.resourcemanager.security.models.WorkspaceSettings; - -public final class WorkspaceSettingsImpl implements WorkspaceSettings { - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingsImpl.class); - - private final WorkspaceSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public WorkspaceSettingsImpl(WorkspaceSettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String workspaceSettingName, Context context) { - Response inner = this.serviceClient().getWithResponse(workspaceSettingName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WorkspaceSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public WorkspaceSetting get(String workspaceSettingName) { - WorkspaceSettingInner inner = this.serviceClient().get(workspaceSettingName); - if (inner != null) { - return new WorkspaceSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String workspaceSettingName, Context context) { - return this.serviceClient().deleteWithResponse(workspaceSettingName, context); - } - - public void delete(String workspaceSettingName) { - this.serviceClient().delete(workspaceSettingName); - } - - public WorkspaceSetting getById(String id) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.getWithResponse(workspaceSettingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.getWithResponse(workspaceSettingName, context); - } - - public void deleteById(String id) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - this.deleteWithResponse(workspaceSettingName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.deleteWithResponse(workspaceSettingName, context); - } - - private WorkspaceSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public WorkspaceSettingImpl define(String name) { - return new WorkspaceSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java deleted file mode 100644 index 5b7c5a7bdb15b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment authentication details. - */ -@Fluent -public final class AccessTokenAuthentication extends Authentication { - /* - * The authentication type - */ - private AuthenticationType authenticationType = AuthenticationType.fromString("AccessToken"); - - /* - * The user name that will be used while authenticating with the onboarded environment - */ - private String username; - - /* - * The access token that will be used while authenticating with the onboarded environment - */ - private String accessToken; - - /** - * Creates an instance of AccessTokenAuthentication class. - */ - public AccessTokenAuthentication() { - } - - /** - * Get the authenticationType property: The authentication type. - * - * @return the authenticationType value. - */ - @Override - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Get the username property: The user name that will be used while authenticating with the onboarded environment. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The user name that will be used while authenticating with the onboarded environment. - * - * @param username the username value to set. - * @return the AccessTokenAuthentication object itself. - */ - public AccessTokenAuthentication withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the accessToken property: The access token that will be used while authenticating with the onboarded - * environment. - * - * @return the accessToken value. - */ - public String accessToken() { - return this.accessToken; - } - - /** - * Set the accessToken property: The access token that will be used while authenticating with the onboarded - * environment. - * - * @param accessToken the accessToken value to set. - * @return the AccessTokenAuthentication object itself. - */ - public AccessTokenAuthentication withAccessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeStringField("username", this.username); - jsonWriter.writeStringField("accessToken", this.accessToken); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccessTokenAuthentication from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccessTokenAuthentication if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AccessTokenAuthentication. - */ - public static AccessTokenAuthentication fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccessTokenAuthentication deserializedAccessTokenAuthentication = new AccessTokenAuthentication(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationType".equals(fieldName)) { - deserializedAccessTokenAuthentication.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("username".equals(fieldName)) { - deserializedAccessTokenAuthentication.username = reader.getString(); - } else if ("accessToken".equals(fieldName)) { - deserializedAccessTokenAuthentication.accessToken = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAccessTokenAuthentication; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java deleted file mode 100644 index 219685a9c196b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ -public final class ActionType extends ExpandableStringEnum { - /** - * Static value Internal for ActionType. - */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Static value LogicApp for ActionType. - */ - public static final ActionType LOGIC_APP = fromString("LogicApp"); - - /** - * Static value EventHub for ActionType. - */ - public static final ActionType EVENT_HUB = fromString("EventHub"); - - /** - * Static value Workspace for ActionType. - */ - public static final ActionType WORKSPACE = fromString("Workspace"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java deleted file mode 100644 index fe65667d6f039..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Configuration payload for PR Annotations. - */ -@Fluent -public final class ActionableRemediation implements JsonSerializable { - /* - * ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - */ - private ActionableRemediationState state; - - /* - * Gets or sets list of categories and severity levels. - */ - private List categoryConfigurations; - - /* - * Repository branch configuration for PR Annotations. - */ - private TargetBranchConfiguration branchConfiguration; - - /* - * Update Settings. - * - * Enabled - Resource should inherit configurations from parent. - * Disabled - Resource should not inherit configurations from parent. - */ - private InheritFromParentState inheritFromParentState; - - /** - * Creates an instance of ActionableRemediation class. - */ - public ActionableRemediation() { - } - - /** - * Get the state property: ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - * - * @return the state value. - */ - public ActionableRemediationState state() { - return this.state; - } - - /** - * Set the state property: ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - * - * @param state the state value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withState(ActionableRemediationState state) { - this.state = state; - return this; - } - - /** - * Get the categoryConfigurations property: Gets or sets list of categories and severity levels. - * - * @return the categoryConfigurations value. - */ - public List categoryConfigurations() { - return this.categoryConfigurations; - } - - /** - * Set the categoryConfigurations property: Gets or sets list of categories and severity levels. - * - * @param categoryConfigurations the categoryConfigurations value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withCategoryConfigurations(List categoryConfigurations) { - this.categoryConfigurations = categoryConfigurations; - return this; - } - - /** - * Get the branchConfiguration property: Repository branch configuration for PR Annotations. - * - * @return the branchConfiguration value. - */ - public TargetBranchConfiguration branchConfiguration() { - return this.branchConfiguration; - } - - /** - * Set the branchConfiguration property: Repository branch configuration for PR Annotations. - * - * @param branchConfiguration the branchConfiguration value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withBranchConfiguration(TargetBranchConfiguration branchConfiguration) { - this.branchConfiguration = branchConfiguration; - return this; - } - - /** - * Get the inheritFromParentState property: Update Settings. - * - * Enabled - Resource should inherit configurations from parent. - * Disabled - Resource should not inherit configurations from parent. - * - * @return the inheritFromParentState value. - */ - public InheritFromParentState inheritFromParentState() { - return this.inheritFromParentState; - } - - /** - * Set the inheritFromParentState property: Update Settings. - * - * Enabled - Resource should inherit configurations from parent. - * Disabled - Resource should not inherit configurations from parent. - * - * @param inheritFromParentState the inheritFromParentState value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withInheritFromParentState(InheritFromParentState inheritFromParentState) { - this.inheritFromParentState = inheritFromParentState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (categoryConfigurations() != null) { - categoryConfigurations().forEach(e -> e.validate()); - } - if (branchConfiguration() != null) { - branchConfiguration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - jsonWriter.writeArrayField("categoryConfigurations", this.categoryConfigurations, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("branchConfiguration", this.branchConfiguration); - jsonWriter.writeStringField("inheritFromParentState", - this.inheritFromParentState == null ? null : this.inheritFromParentState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ActionableRemediation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ActionableRemediation if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ActionableRemediation. - */ - public static ActionableRemediation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ActionableRemediation deserializedActionableRemediation = new ActionableRemediation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedActionableRemediation.state = ActionableRemediationState.fromString(reader.getString()); - } else if ("categoryConfigurations".equals(fieldName)) { - List categoryConfigurations - = reader.readArray(reader1 -> CategoryConfiguration.fromJson(reader1)); - deserializedActionableRemediation.categoryConfigurations = categoryConfigurations; - } else if ("branchConfiguration".equals(fieldName)) { - deserializedActionableRemediation.branchConfiguration = TargetBranchConfiguration.fromJson(reader); - } else if ("inheritFromParentState".equals(fieldName)) { - deserializedActionableRemediation.inheritFromParentState - = InheritFromParentState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedActionableRemediation; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java deleted file mode 100644 index b91d0c146a173..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - */ -public final class ActionableRemediationState extends ExpandableStringEnum { - /** - * Static value None for ActionableRemediationState. - */ - public static final ActionableRemediationState NONE = fromString("None"); - - /** - * Static value Disabled for ActionableRemediationState. - */ - public static final ActionableRemediationState DISABLED = fromString("Disabled"); - - /** - * Static value Enabled for ActionableRemediationState. - */ - public static final ActionableRemediationState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of ActionableRemediationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionableRemediationState() { - } - - /** - * Creates or finds a ActionableRemediationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionableRemediationState. - */ - public static ActionableRemediationState fromString(String name) { - return fromString(name, ActionableRemediationState.class); - } - - /** - * Gets known ActionableRemediationState values. - * - * @return known ActionableRemediationState values. - */ - public static Collection values() { - return values(ActionableRemediationState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java deleted file mode 100644 index b24352cd743f7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details of the sub-assessment. - */ -@Immutable -public class AdditionalData implements JsonSerializable { - /* - * Sub-assessment resource type - */ - private AssessedResourceType assessedResourceType = AssessedResourceType.fromString("AdditionalData"); - - /** - * Creates an instance of AdditionalData class. - */ - public AdditionalData() { - } - - /** - * Get the assessedResourceType property: Sub-assessment resource type. - * - * @return the assessedResourceType value. - */ - public AssessedResourceType assessedResourceType() { - return this.assessedResourceType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assessedResourceType", - this.assessedResourceType == null ? null : this.assessedResourceType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdditionalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdditionalData if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AdditionalData. - */ - public static AdditionalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("assessedResourceType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("SqlServerVulnerability".equals(discriminatorValue)) { - return SqlServerVulnerabilityProperties.fromJson(readerToUse.reset()); - } else if ("ContainerRegistryVulnerability".equals(discriminatorValue)) { - return ContainerRegistryVulnerabilityProperties.fromJson(readerToUse.reset()); - } else if ("ServerVulnerabilityAssessment".equals(discriminatorValue)) { - return ServerVulnerabilityProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AdditionalData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdditionalData deserializedAdditionalData = new AdditionalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessedResourceType".equals(fieldName)) { - deserializedAdditionalData.assessedResourceType - = AssessedResourceType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdditionalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java deleted file mode 100644 index 84cf7a11c1b7c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.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.AlertsSuppressionRuleInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of AlertsSuppressionRule. - */ -public interface AlertsSuppressionRule { - /** - * 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 alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - OffsetDateTime lastModifiedUtc(); - - /** - * Gets the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @return the expirationDateUtc value. - */ - OffsetDateTime expirationDateUtc(); - - /** - * Gets the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - String reason(); - - /** - * Gets the state property: Possible states of the rule. - * - * @return the state value. - */ - RuleState state(); - - /** - * Gets the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - String comment(); - - /** - * Gets the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - SuppressionAlertsScope suppressionAlertsScope(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner object. - * - * @return the inner object. - */ - AlertsSuppressionRuleInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java deleted file mode 100644 index dba56aff33f47..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; - -/** - * Resource collection API of AlertsSuppressionRules. - */ -public interface AlertsSuppressionRules { - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String alertType, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response}. - */ - Response getWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - AlertsSuppressionRule get(String alertsSuppressionRuleName); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response}. - */ - Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule. - */ - AlertsSuppressionRule update(String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 alertsSuppressionRuleName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java deleted file mode 100644 index ff81c7d5c1e4e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import java.io.IOException; -import java.util.List; - -/** - * Suppression rules list for subscription. - */ -@Fluent -public final class AlertsSuppressionRulesList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AlertsSuppressionRulesList class. - */ - public AlertsSuppressionRulesList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the AlertsSuppressionRulesList object itself. - */ - public AlertsSuppressionRulesList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URI to fetch the next page. - * - * @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) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model AlertsSuppressionRulesList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRulesList.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertsSuppressionRulesList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertsSuppressionRulesList if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AlertsSuppressionRulesList. - */ - public static AlertsSuppressionRulesList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertsSuppressionRulesList deserializedAlertsSuppressionRulesList = new AlertsSuppressionRulesList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AlertsSuppressionRuleInner.fromJson(reader1)); - deserializedAlertsSuppressionRulesList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAlertsSuppressionRulesList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertsSuppressionRulesList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java deleted file mode 100644 index 96192d68cc634..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Configuration of PR Annotations on default branch. - * - * Enabled - PR Annotations are enabled on the resource's default branch. - * Disabled - PR Annotations are disabled on the resource's default branch. - */ -public final class AnnotateDefaultBranchState extends ExpandableStringEnum { - /** - * Static value Disabled for AnnotateDefaultBranchState. - */ - public static final AnnotateDefaultBranchState DISABLED = fromString("Disabled"); - - /** - * Static value Enabled for AnnotateDefaultBranchState. - */ - public static final AnnotateDefaultBranchState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of AnnotateDefaultBranchState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AnnotateDefaultBranchState() { - } - - /** - * Creates or finds a AnnotateDefaultBranchState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AnnotateDefaultBranchState. - */ - public static AnnotateDefaultBranchState fromString(String name) { - return fromString(name, AnnotateDefaultBranchState.class); - } - - /** - * Gets known AnnotateDefaultBranchState values. - * - * @return known AnnotateDefaultBranchState values. - */ - public static Collection values() { - return values(AnnotateDefaultBranchState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java deleted file mode 100644 index 51f5fa4954dee..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (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.ApplicationInner; -import java.util.List; - -/** - * An immutable client-side representation of Application. - */ -public interface Application { - /** - * 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 application. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: description of the application. - * - * @return the description value. - */ - String description(); - - /** - * Gets the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - ApplicationSourceResourceType sourceResourceType(); - - /** - * Gets the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - List conditionSets(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ApplicationInner object. - * - * @return the inner object. - */ - ApplicationInner innerModel(); - - /** - * The entirety of the Application definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** - * The Application definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Application definition. - */ - interface Blank extends WithCreate { - } - - /** - * The stage of the Application definition which contains all the minimum required properties for the resource - * to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithDisplayName, DefinitionStages.WithDescription, - DefinitionStages.WithSourceResourceType, DefinitionStages.WithConditionSets { - /** - * Executes the create request. - * - * @return the created resource. - */ - Application create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Application create(Context context); - } - - /** - * The stage of the Application definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the application. - * - * @param displayName display name of the application. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the Application definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: description of the application. - * - * @param description description of the application. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the Application definition allowing to specify sourceResourceType. - */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType The application source, what it affects, e.g. Assessments. - * @return the next definition stage. - */ - WithCreate withSourceResourceType(ApplicationSourceResourceType sourceResourceType); - } - - /** - * The stage of the Application definition allowing to specify conditionSets. - */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets The application conditionSets - see examples. - * @return the next definition stage. - */ - WithCreate withConditionSets(List conditionSets); - } - } - - /** - * Begins update for the Application resource. - * - * @return the stage of resource update. - */ - Application.Update update(); - - /** - * The template for Application update. - */ - interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithDescription, - UpdateStages.WithSourceResourceType, UpdateStages.WithConditionSets { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Application apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Application apply(Context context); - } - - /** - * The Application update stages. - */ - interface UpdateStages { - /** - * The stage of the Application update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the application. - * - * @param displayName display name of the application. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the Application update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: description of the application. - * - * @param description description of the application. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Application update allowing to specify sourceResourceType. - */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType The application source, what it affects, e.g. Assessments. - * @return the next definition stage. - */ - Update withSourceResourceType(ApplicationSourceResourceType sourceResourceType); - } - - /** - * The stage of the Application update allowing to specify conditionSets. - */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets The application conditionSets - see examples. - * @return the next definition stage. - */ - Update withConditionSets(List conditionSets); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Application refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Application refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java deleted file mode 100644 index e5c4555d335d7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ApplicationOperations. - */ -public interface ApplicationOperations { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getWithResponse(String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - Application get(String applicationId); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 applicationId); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 specific application for the requested scope by applicationId along with {@link Response}. - */ - Application getById(String id); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @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 specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete an Application over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete an Application over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Application resource. - * - * @param name resource name. - * @return the first stage of the new Application definition. - */ - Application.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java deleted file mode 100644 index 87904c28b5736..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The application source, what it affects, e.g. Assessments. - */ -public final class ApplicationSourceResourceType extends ExpandableStringEnum { - /** - * Static value Assessments for ApplicationSourceResourceType. - */ - public static final ApplicationSourceResourceType ASSESSMENTS = fromString("Assessments"); - - /** - * Creates a new instance of ApplicationSourceResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ApplicationSourceResourceType() { - } - - /** - * Creates or finds a ApplicationSourceResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationSourceResourceType. - */ - public static ApplicationSourceResourceType fromString(String name) { - return fromString(name, ApplicationSourceResourceType.class); - } - - /** - * Gets known ApplicationSourceResourceType values. - * - * @return known ApplicationSourceResourceType values. - */ - public static Collection values() { - return values(ApplicationSourceResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java deleted file mode 100644 index 5efcf23b1b757..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Applications. - */ -public interface Applications { - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java deleted file mode 100644 index 9f486a36b1b7c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.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.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a security applications list. - */ -@Immutable -public final class ApplicationsList implements JsonSerializable { - /* - * Collection of applications in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of ApplicationsList class. - */ - public ApplicationsList() { - } - - /** - * Get the value property: Collection of applications in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicationsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationsList if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ApplicationsList. - */ - public static ApplicationsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationsList deserializedApplicationsList = new ApplicationsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ApplicationInner.fromJson(reader1)); - deserializedApplicationsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedApplicationsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java deleted file mode 100644 index 74041628fd659..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public class ArcAutoProvisioning implements JsonSerializable { - /* - * Is arc auto provisioning enabled - */ - private Boolean enabled; - - /* - * Configuration for servers Arc auto provisioning for a given environment - */ - private ArcAutoProvisioningConfiguration configuration; - - /** - * Creates an instance of ArcAutoProvisioning class. - */ - public ArcAutoProvisioning() { - } - - /** - * 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 ArcAutoProvisioning object itself. - */ - public ArcAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: Configuration for servers Arc auto provisioning for a given environment. - * - * @return the configuration value. - */ - public ArcAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: Configuration for servers Arc auto provisioning for a given environment. - * - * @param configuration the configuration value to set. - * @return the ArcAutoProvisioning object itself. - */ - public ArcAutoProvisioning withConfiguration(ArcAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeJsonField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioning if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ArcAutoProvisioning. - */ - public static ArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioning deserializedArcAutoProvisioning = new ArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedArcAutoProvisioning.enabled = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedArcAutoProvisioning.configuration = ArcAutoProvisioningConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java deleted file mode 100644 index 1323e0ba9f739..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration for an AWS environment. - */ -@Fluent -public class ArcAutoProvisioningAws extends ArcAutoProvisioning { - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of ArcAutoProvisioningAws class. - */ - public ArcAutoProvisioningAws() { - } - - /** - * 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 ArcAutoProvisioningAws object itself. - */ - public ArcAutoProvisioningAws withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningAws withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningAws withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioningAws from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioningAws if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ArcAutoProvisioningAws. - */ - public static ArcAutoProvisioningAws fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioningAws deserializedArcAutoProvisioningAws = new ArcAutoProvisioningAws(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedArcAutoProvisioningAws.withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedArcAutoProvisioningAws - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedArcAutoProvisioningAws.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioningAws; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java deleted file mode 100644 index e39dc247b4cc2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Configuration for servers Arc auto provisioning for a given environment. - */ -@Fluent -public final class ArcAutoProvisioningConfiguration implements JsonSerializable { - /* - * Optional HTTP proxy endpoint to use for the Arc agent - */ - private String proxy; - - /* - * Optional Arc private link scope resource id to link the Arc agent - */ - private String privateLinkScope; - - /** - * Creates an instance of ArcAutoProvisioningConfiguration class. - */ - public ArcAutoProvisioningConfiguration() { - } - - /** - * Get the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @return the proxy value. - */ - public String proxy() { - return this.proxy; - } - - /** - * Set the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @param proxy the proxy value to set. - * @return the ArcAutoProvisioningConfiguration object itself. - */ - public ArcAutoProvisioningConfiguration withProxy(String proxy) { - this.proxy = proxy; - return this; - } - - /** - * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @return the privateLinkScope value. - */ - public String privateLinkScope() { - return this.privateLinkScope; - } - - /** - * Set the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @param privateLinkScope the privateLinkScope value to set. - * @return the ArcAutoProvisioningConfiguration object itself. - */ - public ArcAutoProvisioningConfiguration withPrivateLinkScope(String privateLinkScope) { - this.privateLinkScope = privateLinkScope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("proxy", this.proxy); - jsonWriter.writeStringField("privateLinkScope", this.privateLinkScope); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioningConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioningConfiguration if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ArcAutoProvisioningConfiguration. - */ - public static ArcAutoProvisioningConfiguration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioningConfiguration deserializedArcAutoProvisioningConfiguration - = new ArcAutoProvisioningConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("proxy".equals(fieldName)) { - deserializedArcAutoProvisioningConfiguration.proxy = reader.getString(); - } else if ("privateLinkScope".equals(fieldName)) { - deserializedArcAutoProvisioningConfiguration.privateLinkScope = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioningConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java deleted file mode 100644 index 15b2d496292c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration for an GCP environment. - */ -@Fluent -public class ArcAutoProvisioningGcp extends ArcAutoProvisioning { - /** - * Creates an instance of ArcAutoProvisioningGcp class. - */ - public ArcAutoProvisioningGcp() { - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningGcp withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningGcp withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioningGcp from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioningGcp if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ArcAutoProvisioningGcp. - */ - public static ArcAutoProvisioningGcp fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioningGcp deserializedArcAutoProvisioningGcp = new ArcAutoProvisioningGcp(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedArcAutoProvisioningGcp.withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedArcAutoProvisioningGcp - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioningGcp; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java deleted file mode 100644 index 2b6a9cd03eba3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; - -/** - * An immutable client-side representation of AscLocation. - */ -public interface AscLocation { - /** - * 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: An empty set of properties. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AscLocationInner object. - * - * @return the inner object. - */ - AscLocationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java deleted file mode 100644 index a53b03be2dbea..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.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.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of locations where ASC saves your data. - */ -@Immutable -public final class AscLocationList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AscLocationList class. - */ - public AscLocationList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AscLocationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AscLocationList if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AscLocationList. - */ - public static AscLocationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AscLocationList deserializedAscLocationList = new AscLocationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AscLocationInner.fromJson(reader1)); - deserializedAscLocationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAscLocationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAscLocationList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java deleted file mode 100644 index 1627745d2c2b0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Sub-assessment resource type. - */ -public final class AssessedResourceType extends ExpandableStringEnum { - /** - * Static value SqlServerVulnerability for AssessedResourceType. - */ - public static final AssessedResourceType SQL_SERVER_VULNERABILITY = fromString("SqlServerVulnerability"); - - /** - * Static value ContainerRegistryVulnerability for AssessedResourceType. - */ - public static final AssessedResourceType CONTAINER_REGISTRY_VULNERABILITY - = fromString("ContainerRegistryVulnerability"); - - /** - * Static value ServerVulnerability for AssessedResourceType. - */ - public static final AssessedResourceType SERVER_VULNERABILITY = fromString("ServerVulnerability"); - - /** - * Creates a new instance of AssessedResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessedResourceType() { - } - - /** - * Creates or finds a AssessedResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessedResourceType. - */ - public static AssessedResourceType fromString(String name) { - return fromString(name, AssessedResourceType.class); - } - - /** - * Gets known AssessedResourceType values. - * - * @return known AssessedResourceType values. - */ - public static Collection values() { - return values(AssessedResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java deleted file mode 100644 index 098f17e6dba8f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment authentication details. - */ -@Immutable -public class Authentication implements JsonSerializable { - /* - * The authentication type - */ - private AuthenticationType authenticationType = AuthenticationType.fromString("Authentication"); - - /** - * Creates an instance of Authentication class. - */ - public Authentication() { - } - - /** - * Get the authenticationType property: The authentication type. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Authentication from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Authentication if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the Authentication. - */ - public static Authentication fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("authenticationType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AccessToken".equals(discriminatorValue)) { - return AccessTokenAuthentication.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static Authentication fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Authentication deserializedAuthentication = new Authentication(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationType".equals(fieldName)) { - deserializedAuthentication.authenticationType = AuthenticationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAuthentication; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java deleted file mode 100644 index 5cb800e6c6753..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Settings for cloud authentication management. - */ -@Immutable -public class AuthenticationDetailsProperties implements JsonSerializable { - /* - * Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use - * account organization credentials. - */ - private AuthenticationType authenticationType = AuthenticationType.fromString("AuthenticationDetailsProperties"); - - /* - * State of the multi-cloud connector - */ - private AuthenticationProvisioningState authenticationProvisioningState; - - /* - * The permissions detected in the cloud account. - */ - private List grantedPermissions; - - /** - * Creates an instance of AuthenticationDetailsProperties class. - */ - public AuthenticationDetailsProperties() { - } - - /** - * Get the authenticationType property: Connect to your cloud account, for AWS use either account credentials or - * role-based authentication. For GCP use account organization credentials. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Get the authenticationProvisioningState property: State of the multi-cloud connector. - * - * @return the authenticationProvisioningState value. - */ - public AuthenticationProvisioningState authenticationProvisioningState() { - return this.authenticationProvisioningState; - } - - /** - * Set the authenticationProvisioningState property: State of the multi-cloud connector. - * - * @param authenticationProvisioningState the authenticationProvisioningState value to set. - * @return the AuthenticationDetailsProperties object itself. - */ - AuthenticationDetailsProperties - withAuthenticationProvisioningState(AuthenticationProvisioningState authenticationProvisioningState) { - this.authenticationProvisioningState = authenticationProvisioningState; - return this; - } - - /** - * Get the grantedPermissions property: The permissions detected in the cloud account. - * - * @return the grantedPermissions value. - */ - public List grantedPermissions() { - return this.grantedPermissions; - } - - /** - * Set the grantedPermissions property: The permissions detected in the cloud account. - * - * @param grantedPermissions the grantedPermissions value to set. - * @return the AuthenticationDetailsProperties object itself. - */ - AuthenticationDetailsProperties withGrantedPermissions(List grantedPermissions) { - this.grantedPermissions = grantedPermissions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AuthenticationDetailsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AuthenticationDetailsProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AuthenticationDetailsProperties. - */ - public static AuthenticationDetailsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("authenticationType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("awsCreds".equals(discriminatorValue)) { - return AwsCredsAuthenticationDetailsProperties.fromJson(readerToUse.reset()); - } else if ("awsAssumeRole".equals(discriminatorValue)) { - return AwAssumeRoleAuthenticationDetailsProperties.fromJson(readerToUse.reset()); - } else if ("gcpCredentials".equals(discriminatorValue)) { - return GcpCredentialsDetailsProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AuthenticationDetailsProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AuthenticationDetailsProperties deserializedAuthenticationDetailsProperties - = new AuthenticationDetailsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationType".equals(fieldName)) { - deserializedAuthenticationDetailsProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("authenticationProvisioningState".equals(fieldName)) { - deserializedAuthenticationDetailsProperties.authenticationProvisioningState - = AuthenticationProvisioningState.fromString(reader.getString()); - } else if ("grantedPermissions".equals(fieldName)) { - List grantedPermissions - = reader.readArray(reader1 -> PermissionProperty.fromString(reader1.getString())); - deserializedAuthenticationDetailsProperties.grantedPermissions = grantedPermissions; - } else { - reader.skipChildren(); - } - } - - return deserializedAuthenticationDetailsProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java deleted file mode 100644 index a3582f57a36a9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * State of the multi-cloud connector. - */ -public final class AuthenticationProvisioningState extends ExpandableStringEnum { - /** - * Static value Valid for AuthenticationProvisioningState. - */ - public static final AuthenticationProvisioningState VALID = fromString("Valid"); - - /** - * Static value Invalid for AuthenticationProvisioningState. - */ - public static final AuthenticationProvisioningState INVALID = fromString("Invalid"); - - /** - * Static value Expired for AuthenticationProvisioningState. - */ - public static final AuthenticationProvisioningState EXPIRED = fromString("Expired"); - - /** - * Static value IncorrectPolicy for AuthenticationProvisioningState. - */ - public static final AuthenticationProvisioningState INCORRECT_POLICY = fromString("IncorrectPolicy"); - - /** - * Creates a new instance of AuthenticationProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AuthenticationProvisioningState() { - } - - /** - * Creates or finds a AuthenticationProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationProvisioningState. - */ - public static AuthenticationProvisioningState fromString(String name) { - return fromString(name, AuthenticationProvisioningState.class); - } - - /** - * Gets known AuthenticationProvisioningState values. - * - * @return known AuthenticationProvisioningState values. - */ - public static Collection values() { - return values(AuthenticationProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java deleted file mode 100644 index 79d4f8a7b9345..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use - * account organization credentials. - */ -public final class AuthenticationType extends ExpandableStringEnum { - /** - * Static value awsCreds for AuthenticationType. - */ - public static final AuthenticationType AWS_CREDS = fromString("awsCreds"); - - /** - * Static value awsAssumeRole for AuthenticationType. - */ - public static final AuthenticationType AWS_ASSUME_ROLE = fromString("awsAssumeRole"); - - /** - * Static value gcpCredentials for AuthenticationType. - */ - public static final AuthenticationType GCP_CREDENTIALS = fromString("gcpCredentials"); - - /** - * Creates a new instance of AuthenticationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AuthenticationType() { - } - - /** - * Creates or finds a AuthenticationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationType. - */ - public static AuthenticationType fromString(String name) { - return fromString(name, AuthenticationType.class); - } - - /** - * Gets known AuthenticationType values. - * - * @return known AuthenticationType values. - */ - public static Collection values() { - return values(AuthenticationType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java deleted file mode 100644 index 4d9ff9d601a50..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Authorization payload. - */ -@Fluent -public final class Authorization implements JsonSerializable { - /* - * Gets or sets one-time OAuth code to exchange for refresh and access tokens. - * - * Only used during PUT/PATCH operations. The secret is cleared during GET. - */ - private String code; - - /** - * Creates an instance of Authorization class. - */ - public Authorization() { - } - - /** - * Get the code property: Gets or sets one-time OAuth code to exchange for refresh and access tokens. - * - * Only used during PUT/PATCH operations. The secret is cleared during GET. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: Gets or sets one-time OAuth code to exchange for refresh and access tokens. - * - * Only used during PUT/PATCH operations. The secret is cleared during GET. - * - * @param code the code value to set. - * @return the Authorization object itself. - */ - public Authorization withCode(String code) { - this.code = code; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("code", this.code); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Authorization from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Authorization if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the Authorization. - */ - public static Authorization fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Authorization deserializedAuthorization = new Authorization(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedAuthorization.code = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAuthorization; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java deleted file mode 100644 index 47a6cc7c28b42..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * AutoDiscovery states. - */ -public final class AutoDiscovery extends ExpandableStringEnum { - /** - * Static value Disabled for AutoDiscovery. - */ - public static final AutoDiscovery DISABLED = fromString("Disabled"); - - /** - * Static value Enabled for AutoDiscovery. - */ - public static final AutoDiscovery ENABLED = fromString("Enabled"); - - /** - * Static value NotApplicable for AutoDiscovery. - */ - public static final AutoDiscovery NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of AutoDiscovery value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoDiscovery() { - } - - /** - * Creates or finds a AutoDiscovery from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoDiscovery. - */ - public static AutoDiscovery fromString(String name) { - return fromString(name, AutoDiscovery.class); - } - - /** - * Gets known AutoDiscovery values. - * - * @return known AutoDiscovery values. - */ - public static Collection values() { - return values(AutoDiscovery.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java deleted file mode 100644 index df4cc349ef70a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Describes what kind of security agent provisioning action to take. - */ -public final class AutoProvision extends ExpandableStringEnum { - /** - * Static value On for AutoProvision. - */ - public static final AutoProvision ON = fromString("On"); - - /** - * Static value Off for AutoProvision. - */ - public static final AutoProvision OFF = fromString("Off"); - - /** - * Creates a new instance of AutoProvision value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoProvision() { - } - - /** - * Creates or finds a AutoProvision from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoProvision. - */ - public static AutoProvision fromString(String name) { - return fromString(name, AutoProvision.class); - } - - /** - * Gets known AutoProvision values. - * - * @return known AutoProvision values. - */ - public static Collection values() { - return values(AutoProvision.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java deleted file mode 100644 index 9925a34a0a57d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.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.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; - -/** - * An immutable client-side representation of AutoProvisioningSetting. - */ -public interface AutoProvisioningSetting { - /** - * 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 autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - AutoProvision autoProvision(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner object. - * - * @return the inner object. - */ - AutoProvisioningSettingInner innerModel(); - - /** - * The entirety of the AutoProvisioningSetting definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** - * The AutoProvisioningSetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AutoProvisioningSetting definition. - */ - interface Blank extends WithCreate { - } - - /** - * The stage of the AutoProvisioningSetting definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithAutoProvision { - /** - * Executes the create request. - * - * @return the created resource. - */ - AutoProvisioningSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AutoProvisioningSetting create(Context context); - } - - /** - * The stage of the AutoProvisioningSetting definition allowing to specify autoProvision. - */ - interface WithAutoProvision { - /** - * Specifies the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision Describes what kind of security agent provisioning action to take. - * @return the next definition stage. - */ - WithCreate withAutoProvision(AutoProvision autoProvision); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AutoProvisioningSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AutoProvisioningSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java deleted file mode 100644 index 3907bc007f8be..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import java.io.IOException; -import java.util.List; - -/** - * List of all the auto provisioning settings response. - */ -@Fluent -public final class AutoProvisioningSettingList implements JsonSerializable { - /* - * List of all the auto provisioning settings - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AutoProvisioningSettingList class. - */ - public AutoProvisioningSettingList() { - } - - /** - * Get the value property: List of all the auto provisioning settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of all the auto provisioning settings. - * - * @param value the value value to set. - * @return the AutoProvisioningSettingList object itself. - */ - public AutoProvisioningSettingList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutoProvisioningSettingList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutoProvisioningSettingList if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutoProvisioningSettingList. - */ - public static AutoProvisioningSettingList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutoProvisioningSettingList deserializedAutoProvisioningSettingList = new AutoProvisioningSettingList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AutoProvisioningSettingInner.fromJson(reader1)); - deserializedAutoProvisioningSettingList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAutoProvisioningSettingList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutoProvisioningSettingList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java deleted file mode 100644 index 772fb6f8a28b8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.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.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AutoProvisioningSettings. - */ -public interface AutoProvisioningSettings { - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - Response getWithResponse(String settingName, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - AutoProvisioningSetting get(String settingName); - - /** - * Details of a specific setting. - * - * @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 auto provisioning setting along with {@link Response}. - */ - AutoProvisioningSetting getById(String id); - - /** - * Details of a specific setting. - * - * @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 auto provisioning setting along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AutoProvisioningSetting resource. - * - * @param name resource name. - * @return the first stage of the new AutoProvisioningSetting definition. - */ - AutoProvisioningSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java deleted file mode 100644 index 1e248cccbe54b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java +++ /dev/null @@ -1,440 +0,0 @@ -// Copyright (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.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of Automation. - */ -public interface Automation { - /** - * 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 description property: The security automation description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - Boolean isEnabled(); - - /** - * Gets 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. - */ - List scopes(); - - /** - * Gets the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - List sources(); - - /** - * Gets 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. - */ - List actions(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutomationInner object. - * - * @return the inner object. - */ - AutomationInner innerModel(); - - /** - * The entirety of the Automation definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The Automation definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Automation definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Automation definition allowing to specify location. - */ - interface WithLocation { - /** - * 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 Automation 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 Automation definition which contains all the minimum required properties for the resource to - * be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithDescription, DefinitionStages.WithIsEnabled, - DefinitionStages.WithScopes, DefinitionStages.WithSources, DefinitionStages.WithActions { - /** - * Executes the create request. - * - * @return the created resource. - */ - Automation create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Automation create(Context context); - } - - /** - * The stage of the Automation 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 Automation definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: The security automation description.. - * - * @param description The security automation description. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the Automation definition allowing to specify isEnabled. - */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether the security automation is enabled.. - * - * @param isEnabled Indicates whether the security automation is enabled. - * @return the next definition stage. - */ - WithCreate withIsEnabled(Boolean isEnabled); - } - - /** - * The stage of the Automation definition allowing to specify scopes. - */ - interface WithScopes { - /** - * Specifies 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 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 next definition stage. - */ - WithCreate withScopes(List scopes); - } - - /** - * The stage of the Automation definition allowing to specify sources. - */ - interface WithSources { - /** - * Specifies the sources property: A collection of the source event types which evaluate the security - * automation set of rules.. - * - * @param sources A collection of the source event types which evaluate the security automation set of - * rules. - * @return the next definition stage. - */ - WithCreate withSources(List sources); - } - - /** - * The stage of the Automation definition allowing to specify actions. - */ - interface WithActions { - /** - * Specifies 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 A collection of the actions which are triggered if all the configured rules evaluations, - * within at least one rule set, are true. - * @return the next definition stage. - */ - WithCreate withActions(List actions); - } - } - - /** - * Begins update for the Automation resource. - * - * @return the stage of resource update. - */ - Automation.Update update(); - - /** - * The template for Automation update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithIsEnabled, - UpdateStages.WithScopes, UpdateStages.WithSources, UpdateStages.WithActions { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Automation apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Automation apply(Context context); - } - - /** - * The Automation update stages. - */ - interface UpdateStages { - /** - * The stage of the Automation update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: A list of key value pairs that describe the resource.. - * - * @param tags A list of key value pairs that describe the resource. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Automation update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: The security automation description.. - * - * @param description The security automation description. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Automation update allowing to specify isEnabled. - */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether the security automation is enabled.. - * - * @param isEnabled Indicates whether the security automation is enabled. - * @return the next definition stage. - */ - Update withIsEnabled(Boolean isEnabled); - } - - /** - * The stage of the Automation update allowing to specify scopes. - */ - interface WithScopes { - /** - * Specifies 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 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 next definition stage. - */ - Update withScopes(List scopes); - } - - /** - * The stage of the Automation update allowing to specify sources. - */ - interface WithSources { - /** - * Specifies the sources property: A collection of the source event types which evaluate the security - * automation set of rules.. - * - * @param sources A collection of the source event types which evaluate the security automation set of - * rules. - * @return the next definition stage. - */ - Update withSources(List sources); - } - - /** - * The stage of the Automation update allowing to specify actions. - */ - interface WithActions { - /** - * Specifies 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 A collection of the actions which are triggered if all the configured rules evaluations, - * within at least one rule set, are true. - * @return the next definition stage. - */ - Update withActions(List actions); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Automation refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Automation refresh(Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param automation The security automation 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 automation model state property bag along with {@link Response}. - */ - Response validateWithResponse(AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param automation The security automation 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 automation model state property bag. - */ - AutomationValidationStatus validate(AutomationInner automation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java deleted file mode 100644 index 18a8278a61e60..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The action that should be triggered. - */ -@Immutable -public class AutomationAction implements JsonSerializable { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.fromString("AutomationAction"); - - /** - * Creates an instance of AutomationAction class. - */ - public AutomationAction() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationAction if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationAction. - */ - public static AutomationAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("actionType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("LogicApp".equals(discriminatorValue)) { - return AutomationActionLogicApp.fromJson(readerToUse.reset()); - } else if ("EventHub".equals(discriminatorValue)) { - return AutomationActionEventHub.fromJson(readerToUse.reset()); - } else if ("Workspace".equals(discriminatorValue)) { - return AutomationActionWorkspace.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AutomationAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationAction deserializedAutomationAction = new AutomationAction(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationAction.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationAction; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java deleted file mode 100644 index fb33d6aa348fd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud - * continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - */ -@Fluent -public final class AutomationActionEventHub extends AutomationAction { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.EVENT_HUB; - - /* - * The target Event Hub Azure Resource ID. - */ - private String eventHubResourceId; - - /* - * The target Event Hub SAS policy name. - */ - private String sasPolicyName; - - /* - * The target Event Hub connection string (it will not be included in any response). - */ - private String connectionString; - - /* - * Indicates whether the trusted service is enabled or not. - */ - private Boolean isTrustedServiceEnabled; - - /** - * Creates an instance of AutomationActionEventHub class. - */ - public AutomationActionEventHub() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - @Override - public ActionType actionType() { - return this.actionType; - } - - /** - * Get the eventHubResourceId property: The target Event Hub Azure Resource ID. - * - * @return the eventHubResourceId value. - */ - public String eventHubResourceId() { - return this.eventHubResourceId; - } - - /** - * Set the eventHubResourceId property: The target Event Hub Azure Resource ID. - * - * @param eventHubResourceId the eventHubResourceId value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withEventHubResourceId(String eventHubResourceId) { - this.eventHubResourceId = eventHubResourceId; - return this; - } - - /** - * Get the sasPolicyName property: The target Event Hub SAS policy name. - * - * @return the sasPolicyName value. - */ - public String sasPolicyName() { - return this.sasPolicyName; - } - - /** - * Get the connectionString property: The target Event Hub connection string (it will not be included in any - * response). - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The target Event Hub connection string (it will not be included in any - * response). - * - * @param connectionString the connectionString value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the isTrustedServiceEnabled property: Indicates whether the trusted service is enabled or not. - * - * @return the isTrustedServiceEnabled value. - */ - public Boolean isTrustedServiceEnabled() { - return this.isTrustedServiceEnabled; - } - - /** - * Set the isTrustedServiceEnabled property: Indicates whether the trusted service is enabled or not. - * - * @param isTrustedServiceEnabled the isTrustedServiceEnabled value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withIsTrustedServiceEnabled(Boolean isTrustedServiceEnabled) { - this.isTrustedServiceEnabled = isTrustedServiceEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeStringField("eventHubResourceId", this.eventHubResourceId); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeBooleanField("isTrustedServiceEnabled", this.isTrustedServiceEnabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationActionEventHub from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationActionEventHub if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationActionEventHub. - */ - public static AutomationActionEventHub fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationActionEventHub deserializedAutomationActionEventHub = new AutomationActionEventHub(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationActionEventHub.actionType = ActionType.fromString(reader.getString()); - } else if ("eventHubResourceId".equals(fieldName)) { - deserializedAutomationActionEventHub.eventHubResourceId = reader.getString(); - } else if ("sasPolicyName".equals(fieldName)) { - deserializedAutomationActionEventHub.sasPolicyName = reader.getString(); - } else if ("connectionString".equals(fieldName)) { - deserializedAutomationActionEventHub.connectionString = reader.getString(); - } else if ("isTrustedServiceEnabled".equals(fieldName)) { - deserializedAutomationActionEventHub.isTrustedServiceEnabled - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationActionEventHub; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java deleted file mode 100644 index e754ac731116b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation - * capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore. - */ -@Fluent -public final class AutomationActionLogicApp extends AutomationAction { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.LOGIC_APP; - - /* - * The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have - * permissions to trigger the Logic App - */ - private String logicAppResourceId; - - /* - * The Logic App trigger URI endpoint (it will not be included in any response). - */ - private String uri; - - /** - * Creates an instance of AutomationActionLogicApp class. - */ - public AutomationActionLogicApp() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - @Override - public ActionType actionType() { - return this.actionType; - } - - /** - * Get the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other - * subscriptions, given that you have permissions to trigger the Logic App. - * - * @return the logicAppResourceId value. - */ - public String logicAppResourceId() { - return this.logicAppResourceId; - } - - /** - * Set the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other - * subscriptions, given that you have permissions to trigger the Logic App. - * - * @param logicAppResourceId the logicAppResourceId value to set. - * @return the AutomationActionLogicApp object itself. - */ - public AutomationActionLogicApp withLogicAppResourceId(String logicAppResourceId) { - this.logicAppResourceId = logicAppResourceId; - return this; - } - - /** - * Get the uri property: The Logic App trigger URI endpoint (it will not be included in any response). - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: The Logic App trigger URI endpoint (it will not be included in any response). - * - * @param uri the uri value to set. - * @return the AutomationActionLogicApp object itself. - */ - public AutomationActionLogicApp withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeStringField("logicAppResourceId", this.logicAppResourceId); - jsonWriter.writeStringField("uri", this.uri); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationActionLogicApp from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationActionLogicApp if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationActionLogicApp. - */ - public static AutomationActionLogicApp fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationActionLogicApp deserializedAutomationActionLogicApp = new AutomationActionLogicApp(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationActionLogicApp.actionType = ActionType.fromString(reader.getString()); - } else if ("logicAppResourceId".equals(fieldName)) { - deserializedAutomationActionLogicApp.logicAppResourceId = reader.getString(); - } else if ("uri".equals(fieldName)) { - deserializedAutomationActionLogicApp.uri = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationActionLogicApp; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java deleted file mode 100644 index aac427dd81514..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the - * 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the - * 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center - * Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender - * for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - */ -@Fluent -public final class AutomationActionWorkspace extends AutomationAction { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.WORKSPACE; - - /* - * The fully qualified Log Analytics Workspace Azure Resource ID. - */ - private String workspaceResourceId; - - /** - * Creates an instance of AutomationActionWorkspace class. - */ - public AutomationActionWorkspace() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - @Override - public ActionType actionType() { - return this.actionType; - } - - /** - * Get the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * - * @return the workspaceResourceId value. - */ - public String workspaceResourceId() { - return this.workspaceResourceId; - } - - /** - * Set the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * - * @param workspaceResourceId the workspaceResourceId value to set. - * @return the AutomationActionWorkspace object itself. - */ - public AutomationActionWorkspace withWorkspaceResourceId(String workspaceResourceId) { - this.workspaceResourceId = workspaceResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeStringField("workspaceResourceId", this.workspaceResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationActionWorkspace from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationActionWorkspace if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationActionWorkspace. - */ - public static AutomationActionWorkspace fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationActionWorkspace deserializedAutomationActionWorkspace = new AutomationActionWorkspace(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationActionWorkspace.actionType = ActionType.fromString(reader.getString()); - } else if ("workspaceResourceId".equals(fieldName)) { - deserializedAutomationActionWorkspace.workspaceResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationActionWorkspace; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java deleted file mode 100644 index ce35d45de9de6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security automations response. - */ -@Fluent -public final class AutomationList implements JsonSerializable { - /* - * The list of security automations under the given scope. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AutomationList class. - */ - public AutomationList() { - } - - /** - * Get the value property: The list of security automations under the given scope. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of security automations under the given scope. - * - * @param value the value value to set. - * @return the AutomationList object itself. - */ - public AutomationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model AutomationList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutomationList.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationList if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AutomationList. - */ - public static AutomationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationList deserializedAutomationList = new AutomationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AutomationInner.fromJson(reader1)); - deserializedAutomationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAutomationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java deleted file mode 100644 index 9f5b631de0cdb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set - * will be evaluated as 'true', will the event trigger the defined actions. - */ -@Fluent -public final class AutomationRuleSet implements JsonSerializable { - /* - * The rules property. - */ - private List rules; - - /** - * Creates an instance of AutomationRuleSet class. - */ - public AutomationRuleSet() { - } - - /** - * Get the rules property: The rules property. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The rules property. - * - * @param rules the rules value to set. - * @return the AutomationRuleSet object itself. - */ - public AutomationRuleSet withRules(List rules) { - this.rules = rules; - 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationRuleSet from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationRuleSet if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationRuleSet. - */ - public static AutomationRuleSet fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationRuleSet deserializedAutomationRuleSet = new AutomationRuleSet(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("rules".equals(fieldName)) { - List rules - = reader.readArray(reader1 -> AutomationTriggeringRule.fromJson(reader1)); - deserializedAutomationRuleSet.rules = rules; - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationRuleSet; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java deleted file mode 100644 index 68d7321c912be..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A single automation scope. - */ -@Fluent -public final class AutomationScope implements JsonSerializable { - /* - * The resources scope description. - */ - private String description; - - /* - * The resources scope path. Can be the subscription on which the automation is defined on or a resource group under - * that subscription (fully qualified Azure resource IDs). - */ - private String scopePath; - - /** - * Creates an instance of AutomationScope class. - */ - public AutomationScope() { - } - - /** - * Get the description property: The resources scope description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The resources scope description. - * - * @param description the description value to set. - * @return the AutomationScope object itself. - */ - public AutomationScope withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the scopePath property: The resources scope path. Can be the subscription on which the automation is defined - * on or a resource group under that subscription (fully qualified Azure resource IDs). - * - * @return the scopePath value. - */ - public String scopePath() { - return this.scopePath; - } - - /** - * Set the scopePath property: The resources scope path. Can be the subscription on which the automation is defined - * on or a resource group under that subscription (fully qualified Azure resource IDs). - * - * @param scopePath the scopePath value to set. - * @return the AutomationScope object itself. - */ - public AutomationScope withScopePath(String scopePath) { - this.scopePath = scopePath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("scopePath", this.scopePath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationScope from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationScope if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationScope. - */ - public static AutomationScope fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationScope deserializedAutomationScope = new AutomationScope(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAutomationScope.description = reader.getString(); - } else if ("scopePath".equals(fieldName)) { - deserializedAutomationScope.scopePath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationScope; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java deleted file mode 100644 index 12ef328c2f725..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The source event types which evaluate the security automation set of rules. For example - security alerts and - * security assessments. To learn more about the supported security events data models schemas - please visit - * https://aka.ms/ASCAutomationSchemas. - */ -@Fluent -public final class AutomationSource implements JsonSerializable { - /* - * A valid event source type. - */ - private EventSource eventSource; - - /* - * A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets - * (logical 'or'). - */ - private List ruleSets; - - /** - * Creates an instance of AutomationSource class. - */ - public AutomationSource() { - } - - /** - * Get the eventSource property: A valid event source type. - * - * @return the eventSource value. - */ - public EventSource eventSource() { - return this.eventSource; - } - - /** - * Set the eventSource property: A valid event source type. - * - * @param eventSource the eventSource value to set. - * @return the AutomationSource object itself. - */ - public AutomationSource withEventSource(EventSource eventSource) { - this.eventSource = eventSource; - return this; - } - - /** - * Get the ruleSets property: A set of rules which evaluate upon event interception. A logical disjunction is - * applied between defined rule sets (logical 'or'). - * - * @return the ruleSets value. - */ - public List ruleSets() { - return this.ruleSets; - } - - /** - * Set the ruleSets property: A set of rules which evaluate upon event interception. A logical disjunction is - * applied between defined rule sets (logical 'or'). - * - * @param ruleSets the ruleSets value to set. - * @return the AutomationSource object itself. - */ - public AutomationSource withRuleSets(List ruleSets) { - this.ruleSets = ruleSets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ruleSets() != null) { - ruleSets().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("eventSource", this.eventSource == null ? null : this.eventSource.toString()); - jsonWriter.writeArrayField("ruleSets", this.ruleSets, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationSource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationSource if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationSource. - */ - public static AutomationSource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationSource deserializedAutomationSource = new AutomationSource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("eventSource".equals(fieldName)) { - deserializedAutomationSource.eventSource = EventSource.fromString(reader.getString()); - } else if ("ruleSets".equals(fieldName)) { - List ruleSets = reader.readArray(reader1 -> AutomationRuleSet.fromJson(reader1)); - deserializedAutomationSource.ruleSets = ruleSets; - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationSource; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java deleted file mode 100644 index a4621338eec88..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the - * event model to an expected value. This comparison is done by using one of the supported operators set. - */ -@Fluent -public final class AutomationTriggeringRule implements JsonSerializable { - /* - * The JPath of the entity model property that should be checked. - */ - private String propertyJPath; - - /* - * The data type of the compared operands (string, integer, floating point number or a boolean [true/false]] - */ - private PropertyType propertyType; - - /* - * The expected value. - */ - private String expectedValue; - - /* - * A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. - */ - private Operator operator; - - /** - * Creates an instance of AutomationTriggeringRule class. - */ - public AutomationTriggeringRule() { - } - - /** - * Get the propertyJPath property: The JPath of the entity model property that should be checked. - * - * @return the propertyJPath value. - */ - public String propertyJPath() { - return this.propertyJPath; - } - - /** - * Set the propertyJPath property: The JPath of the entity model property that should be checked. - * - * @param propertyJPath the propertyJPath value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withPropertyJPath(String propertyJPath) { - this.propertyJPath = propertyJPath; - return this; - } - - /** - * Get the propertyType property: The data type of the compared operands (string, integer, floating point number or - * a boolean [true/false]]. - * - * @return the propertyType value. - */ - public PropertyType propertyType() { - return this.propertyType; - } - - /** - * Set the propertyType property: The data type of the compared operands (string, integer, floating point number or - * a boolean [true/false]]. - * - * @param propertyType the propertyType value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withPropertyType(PropertyType propertyType) { - this.propertyType = propertyType; - return this; - } - - /** - * Get the expectedValue property: The expected value. - * - * @return the expectedValue value. - */ - public String expectedValue() { - return this.expectedValue; - } - - /** - * Set the expectedValue property: The expected value. - * - * @param expectedValue the expectedValue value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withExpectedValue(String expectedValue) { - this.expectedValue = expectedValue; - return this; - } - - /** - * Get the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for - * String PropertyType. - * - * @return the operator value. - */ - public Operator operator() { - return this.operator; - } - - /** - * Set the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for - * String PropertyType. - * - * @param operator the operator value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withOperator(Operator operator) { - this.operator = operator; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("propertyJPath", this.propertyJPath); - jsonWriter.writeStringField("propertyType", this.propertyType == null ? null : this.propertyType.toString()); - jsonWriter.writeStringField("expectedValue", this.expectedValue); - jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationTriggeringRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationTriggeringRule if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationTriggeringRule. - */ - public static AutomationTriggeringRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationTriggeringRule deserializedAutomationTriggeringRule = new AutomationTriggeringRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("propertyJPath".equals(fieldName)) { - deserializedAutomationTriggeringRule.propertyJPath = reader.getString(); - } else if ("propertyType".equals(fieldName)) { - deserializedAutomationTriggeringRule.propertyType = PropertyType.fromString(reader.getString()); - } else if ("expectedValue".equals(fieldName)) { - deserializedAutomationTriggeringRule.expectedValue = reader.getString(); - } else if ("operator".equals(fieldName)) { - deserializedAutomationTriggeringRule.operator = Operator.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationTriggeringRule; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java deleted file mode 100644 index 74d94bacaafb1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AutomationProperties; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The update model of security automation resource. - */ -@Fluent -public final class AutomationUpdateModel extends Tags { - /* - * Security automation data - */ - private AutomationProperties innerProperties; - - /** - * Creates an instance of AutomationUpdateModel class. - */ - public AutomationUpdateModel() { - } - - /** - * Get the innerProperties property: Security automation data. - * - * @return the innerProperties value. - */ - private AutomationProperties innerProperties() { - return this.innerProperties; - } - - /** - * {@inheritDoc} - */ - @Override - public AutomationUpdateModel withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withIsEnabled(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.innerProperties() == null ? null : this.innerProperties().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 AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withScopes(List scopes) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withScopes(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.innerProperties() == null ? null : this.innerProperties().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 AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withSources(List sources) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withSources(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.innerProperties() == null ? null : this.innerProperties().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 AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationUpdateModel from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationUpdateModel if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AutomationUpdateModel. - */ - public static AutomationUpdateModel fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationUpdateModel deserializedAutomationUpdateModel = new AutomationUpdateModel(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAutomationUpdateModel.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedAutomationUpdateModel.innerProperties = AutomationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationUpdateModel; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java deleted file mode 100644 index 5aa5b623c85ca..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; - -/** - * An immutable client-side representation of AutomationValidationStatus. - */ -public interface AutomationValidationStatus { - /** - * Gets the isValid property: Indicates whether the model is valid or not. - * - * @return the isValid value. - */ - Boolean isValid(); - - /** - * Gets the message property: The validation message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner object. - * - * @return the inner object. - */ - AutomationValidationStatusInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java deleted file mode 100644 index 6b9a1155a8282..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; - -/** - * Resource collection API of Automations. - */ -public interface Automations { - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations 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 automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation 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 automation resource. - */ - Automation getByResourceGroup(String resourceGroupName, String automationName); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String automationName, Context context); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String automationName); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag along with {@link Response}. - */ - Response validateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 automation model state property bag. - */ - AutomationValidationStatus validate(String resourceGroupName, String automationName, AutomationInner automation); - - /** - * Retrieves information about the model of a security automation. - * - * @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 security automation resource along with {@link Response}. - */ - Automation getById(String id); - - /** - * Retrieves information about the model of a security automation. - * - * @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 security automation resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a security automation. - * - * @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 security automation. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Automation resource. - * - * @param name resource name. - * @return the first stage of the new Automation definition. - */ - Automation.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java deleted file mode 100644 index 95880a31e5f54..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * AWS cloud account connector based assume role, the role enables delegating access to your AWS resources. The role is - * composed of role Amazon Resource Name (ARN) and external ID. For more details, refer to <a - * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html">Creating a Role to Delegate - * Permissions to an IAM User (write only)</a>. - */ -@Fluent -public final class AwAssumeRoleAuthenticationDetailsProperties extends AuthenticationDetailsProperties { - /* - * Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use - * account organization credentials. - */ - private AuthenticationType authenticationType = AuthenticationType.AWS_ASSUME_ROLE; - - /* - * The ID of the cloud account - */ - private String accountId; - - /* - * Assumed role ID is an identifier that you can use to create temporary security credentials. - */ - private String awsAssumeRoleArn; - - /* - * A unique identifier that is required when you assume a role in another account. - */ - private String awsExternalId; - - /** - * Creates an instance of AwAssumeRoleAuthenticationDetailsProperties class. - */ - public AwAssumeRoleAuthenticationDetailsProperties() { - } - - /** - * Get the authenticationType property: Connect to your cloud account, for AWS use either account credentials or - * role-based authentication. For GCP use account organization credentials. - * - * @return the authenticationType value. - */ - @Override - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Get the accountId property: The ID of the cloud account. - * - * @return the accountId value. - */ - public String accountId() { - return this.accountId; - } - - /** - * Get the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary security - * credentials. - * - * @return the awsAssumeRoleArn value. - */ - public String awsAssumeRoleArn() { - return this.awsAssumeRoleArn; - } - - /** - * Set the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary security - * credentials. - * - * @param awsAssumeRoleArn the awsAssumeRoleArn value to set. - * @return the AwAssumeRoleAuthenticationDetailsProperties object itself. - */ - public AwAssumeRoleAuthenticationDetailsProperties withAwsAssumeRoleArn(String awsAssumeRoleArn) { - this.awsAssumeRoleArn = awsAssumeRoleArn; - return this; - } - - /** - * Get the awsExternalId property: A unique identifier that is required when you assume a role in another account. - * - * @return the awsExternalId value. - */ - public String awsExternalId() { - return this.awsExternalId; - } - - /** - * Set the awsExternalId property: A unique identifier that is required when you assume a role in another account. - * - * @param awsExternalId the awsExternalId value to set. - * @return the AwAssumeRoleAuthenticationDetailsProperties object itself. - */ - public AwAssumeRoleAuthenticationDetailsProperties withAwsExternalId(String awsExternalId) { - this.awsExternalId = awsExternalId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (awsAssumeRoleArn() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property awsAssumeRoleArn in model AwAssumeRoleAuthenticationDetailsProperties")); - } - if (awsExternalId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property awsExternalId in model AwAssumeRoleAuthenticationDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AwAssumeRoleAuthenticationDetailsProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("awsAssumeRoleArn", this.awsAssumeRoleArn); - jsonWriter.writeStringField("awsExternalId", this.awsExternalId); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwAssumeRoleAuthenticationDetailsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwAssumeRoleAuthenticationDetailsProperties if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AwAssumeRoleAuthenticationDetailsProperties. - */ - public static AwAssumeRoleAuthenticationDetailsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwAssumeRoleAuthenticationDetailsProperties deserializedAwAssumeRoleAuthenticationDetailsProperties - = new AwAssumeRoleAuthenticationDetailsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationProvisioningState".equals(fieldName)) { - deserializedAwAssumeRoleAuthenticationDetailsProperties.withAuthenticationProvisioningState( - AuthenticationProvisioningState.fromString(reader.getString())); - } else if ("grantedPermissions".equals(fieldName)) { - List grantedPermissions - = reader.readArray(reader1 -> PermissionProperty.fromString(reader1.getString())); - deserializedAwAssumeRoleAuthenticationDetailsProperties.withGrantedPermissions(grantedPermissions); - } else if ("awsAssumeRoleArn".equals(fieldName)) { - deserializedAwAssumeRoleAuthenticationDetailsProperties.awsAssumeRoleArn = reader.getString(); - } else if ("awsExternalId".equals(fieldName)) { - deserializedAwAssumeRoleAuthenticationDetailsProperties.awsExternalId = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedAwAssumeRoleAuthenticationDetailsProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("accountId".equals(fieldName)) { - deserializedAwAssumeRoleAuthenticationDetailsProperties.accountId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAwAssumeRoleAuthenticationDetailsProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java deleted file mode 100644 index a1149521222d4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * AWS cloud account connector based credentials, the credentials is composed of access key ID and secret key, for more - * details, refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html">Creating an - * IAM User in Your AWS Account (write only)</a>. - */ -@Fluent -public final class AwsCredsAuthenticationDetailsProperties extends AuthenticationDetailsProperties { - /* - * Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use - * account organization credentials. - */ - private AuthenticationType authenticationType = AuthenticationType.AWS_CREDS; - - /* - * The ID of the cloud account - */ - private String accountId; - - /* - * Public key element of the AWS credential object (write only) - */ - private String awsAccessKeyId; - - /* - * Secret key element of the AWS credential object (write only) - */ - private String awsSecretAccessKey; - - /** - * Creates an instance of AwsCredsAuthenticationDetailsProperties class. - */ - public AwsCredsAuthenticationDetailsProperties() { - } - - /** - * Get the authenticationType property: Connect to your cloud account, for AWS use either account credentials or - * role-based authentication. For GCP use account organization credentials. - * - * @return the authenticationType value. - */ - @Override - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Get the accountId property: The ID of the cloud account. - * - * @return the accountId value. - */ - public String accountId() { - return this.accountId; - } - - /** - * Get the awsAccessKeyId property: Public key element of the AWS credential object (write only). - * - * @return the awsAccessKeyId value. - */ - public String awsAccessKeyId() { - return this.awsAccessKeyId; - } - - /** - * Set the awsAccessKeyId property: Public key element of the AWS credential object (write only). - * - * @param awsAccessKeyId the awsAccessKeyId value to set. - * @return the AwsCredsAuthenticationDetailsProperties object itself. - */ - public AwsCredsAuthenticationDetailsProperties withAwsAccessKeyId(String awsAccessKeyId) { - this.awsAccessKeyId = awsAccessKeyId; - return this; - } - - /** - * Get the awsSecretAccessKey property: Secret key element of the AWS credential object (write only). - * - * @return the awsSecretAccessKey value. - */ - public String awsSecretAccessKey() { - return this.awsSecretAccessKey; - } - - /** - * Set the awsSecretAccessKey property: Secret key element of the AWS credential object (write only). - * - * @param awsSecretAccessKey the awsSecretAccessKey value to set. - * @return the AwsCredsAuthenticationDetailsProperties object itself. - */ - public AwsCredsAuthenticationDetailsProperties withAwsSecretAccessKey(String awsSecretAccessKey) { - this.awsSecretAccessKey = awsSecretAccessKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (awsAccessKeyId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property awsAccessKeyId in model AwsCredsAuthenticationDetailsProperties")); - } - if (awsSecretAccessKey() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property awsSecretAccessKey in model AwsCredsAuthenticationDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AwsCredsAuthenticationDetailsProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("awsAccessKeyId", this.awsAccessKeyId); - jsonWriter.writeStringField("awsSecretAccessKey", this.awsSecretAccessKey); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsCredsAuthenticationDetailsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsCredsAuthenticationDetailsProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AwsCredsAuthenticationDetailsProperties. - */ - public static AwsCredsAuthenticationDetailsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsCredsAuthenticationDetailsProperties deserializedAwsCredsAuthenticationDetailsProperties - = new AwsCredsAuthenticationDetailsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationProvisioningState".equals(fieldName)) { - deserializedAwsCredsAuthenticationDetailsProperties.withAuthenticationProvisioningState( - AuthenticationProvisioningState.fromString(reader.getString())); - } else if ("grantedPermissions".equals(fieldName)) { - List grantedPermissions - = reader.readArray(reader1 -> PermissionProperty.fromString(reader1.getString())); - deserializedAwsCredsAuthenticationDetailsProperties.withGrantedPermissions(grantedPermissions); - } else if ("awsAccessKeyId".equals(fieldName)) { - deserializedAwsCredsAuthenticationDetailsProperties.awsAccessKeyId = reader.getString(); - } else if ("awsSecretAccessKey".equals(fieldName)) { - deserializedAwsCredsAuthenticationDetailsProperties.awsSecretAccessKey = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedAwsCredsAuthenticationDetailsProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("accountId".equals(fieldName)) { - deserializedAwsCredsAuthenticationDetailsProperties.accountId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsCredsAuthenticationDetailsProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java deleted file mode 100644 index 9fd3c91e8749e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The AWS connector environment data. - */ -@Fluent -public final class AwsEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.AWS_ACCOUNT; - - /* - * The AWS account's organizational data - */ - private AwsOrganizationalData organizationalData; - - /* - * list of regions to scan - */ - private List regions; - - /* - * The AWS account name - */ - private String accountName; - - /* - * Scan interval in hours (value should be between 1-hour to 24-hours) - */ - private Long scanInterval; - - /** - * Creates an instance of AwsEnvironmentData class. - */ - public AwsEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Get the organizationalData property: The AWS account's organizational data. - * - * @return the organizationalData value. - */ - public AwsOrganizationalData organizationalData() { - return this.organizationalData; - } - - /** - * Set the organizationalData property: The AWS account's organizational data. - * - * @param organizationalData the organizationalData value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withOrganizationalData(AwsOrganizationalData organizationalData) { - this.organizationalData = organizationalData; - return this; - } - - /** - * Get the regions property: list of regions to scan. - * - * @return the regions value. - */ - public List regions() { - return this.regions; - } - - /** - * Set the regions property: list of regions to scan. - * - * @param regions the regions value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withRegions(List regions) { - this.regions = regions; - return this; - } - - /** - * Get the accountName property: The AWS account name. - * - * @return the accountName value. - */ - public String accountName() { - return this.accountName; - } - - /** - * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @return the scanInterval value. - */ - public Long scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @param scanInterval the scanInterval value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withScanInterval(Long scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (organizationalData() != null) { - organizationalData().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("organizationalData", this.organizationalData); - jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeString(element)); - jsonWriter.writeNumberField("scanInterval", this.scanInterval); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsEnvironmentData if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AwsEnvironmentData. - */ - public static AwsEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsEnvironmentData deserializedAwsEnvironmentData = new AwsEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedAwsEnvironmentData.environmentType = EnvironmentType.fromString(reader.getString()); - } else if ("organizationalData".equals(fieldName)) { - deserializedAwsEnvironmentData.organizationalData = AwsOrganizationalData.fromJson(reader); - } else if ("regions".equals(fieldName)) { - List regions = reader.readArray(reader1 -> reader1.getString()); - deserializedAwsEnvironmentData.regions = regions; - } else if ("accountName".equals(fieldName)) { - deserializedAwsEnvironmentData.accountName = reader.getString(); - } else if ("scanInterval".equals(fieldName)) { - deserializedAwsEnvironmentData.scanInterval = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java deleted file mode 100644 index 56b92e1a19ed3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AWS organization data. - */ -@Immutable -public class AwsOrganizationalData implements JsonSerializable { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType - = OrganizationMembershipType.fromString("AwsOrganizationalData"); - - /** - * Creates an instance of AwsOrganizationalData class. - */ - public AwsOrganizationalData() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsOrganizationalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsOrganizationalData if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AwsOrganizationalData. - */ - public static AwsOrganizationalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("organizationMembershipType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Organization".equals(discriminatorValue)) { - return AwsOrganizationalDataMaster.fromJson(readerToUse.reset()); - } else if ("Member".equals(discriminatorValue)) { - return AwsOrganizationalDataMember.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AwsOrganizationalData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsOrganizationalData deserializedAwsOrganizationalData = new AwsOrganizationalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedAwsOrganizationalData.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsOrganizationalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java deleted file mode 100644 index b4184946631c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The AWS organization data for the master account. - */ -@Fluent -public final class AwsOrganizationalDataMaster extends AwsOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.ORGANIZATION; - - /* - * If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset - */ - private String stacksetName; - - /* - * If the multi cloud account is of membership type organization, list of accounts excluded from offering - */ - private List excludedAccountIds; - - /** - * Creates an instance of AwsOrganizationalDataMaster class. - */ - public AwsOrganizationalDataMaster() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * 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 AwsOrganizationalDataMaster object itself. - */ - public AwsOrganizationalDataMaster 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 AwsOrganizationalDataMaster object itself. - */ - public AwsOrganizationalDataMaster withExcludedAccountIds(List excludedAccountIds) { - this.excludedAccountIds = excludedAccountIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeStringField("stacksetName", this.stacksetName); - jsonWriter.writeArrayField("excludedAccountIds", this.excludedAccountIds, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsOrganizationalDataMaster from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsOrganizationalDataMaster if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AwsOrganizationalDataMaster. - */ - public static AwsOrganizationalDataMaster fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsOrganizationalDataMaster deserializedAwsOrganizationalDataMaster = new AwsOrganizationalDataMaster(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedAwsOrganizationalDataMaster.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("stacksetName".equals(fieldName)) { - deserializedAwsOrganizationalDataMaster.stacksetName = reader.getString(); - } else if ("excludedAccountIds".equals(fieldName)) { - List excludedAccountIds = reader.readArray(reader1 -> reader1.getString()); - deserializedAwsOrganizationalDataMaster.excludedAccountIds = excludedAccountIds; - } else { - reader.skipChildren(); - } - } - - return deserializedAwsOrganizationalDataMaster; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java deleted file mode 100644 index 1b9943d0a9cee..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AWS organization data for the member account. - */ -@Fluent -public final class AwsOrganizationalDataMember extends AwsOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.MEMBER; - - /* - * If the multi cloud account is not of membership type organization, this will be the ID of the account's parent - */ - private String parentHierarchyId; - - /** - * Creates an instance of AwsOrganizationalDataMember class. - */ - public AwsOrganizationalDataMember() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * 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 AwsOrganizationalDataMember object itself. - */ - public AwsOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) { - this.parentHierarchyId = parentHierarchyId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeStringField("parentHierarchyId", this.parentHierarchyId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsOrganizationalDataMember from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsOrganizationalDataMember if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AwsOrganizationalDataMember. - */ - public static AwsOrganizationalDataMember fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsOrganizationalDataMember deserializedAwsOrganizationalDataMember = new AwsOrganizationalDataMember(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedAwsOrganizationalDataMember.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("parentHierarchyId".equals(fieldName)) { - deserializedAwsOrganizationalDataMember.parentHierarchyId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsOrganizationalDataMember; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java deleted file mode 100644 index efd6f400d3caf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; - -/** - * An immutable client-side representation of AzureDevOpsOrg. - */ -public interface AzureDevOpsOrg { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: Azure DevOps Organization properties. - * - * @return the properties value. - */ - AzureDevOpsOrgProperties properties(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner object. - * - * @return the inner object. - */ - AzureDevOpsOrgInner innerModel(); - - /** - * The entirety of the AzureDevOpsOrg definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureDevOpsOrg definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureDevOpsOrg definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureDevOpsOrg definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @return the next definition stage. - */ - WithCreate withExistingSecurityConnector(String resourceGroupName, String securityConnectorName); - } - - /** - * The stage of the AzureDevOpsOrg definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureDevOpsOrg create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureDevOpsOrg create(Context context); - } - - /** - * The stage of the AzureDevOpsOrg definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Organization properties.. - * - * @param properties Azure DevOps Organization properties. - * @return the next definition stage. - */ - WithCreate withProperties(AzureDevOpsOrgProperties properties); - } - } - - /** - * Begins update for the AzureDevOpsOrg resource. - * - * @return the stage of resource update. - */ - AzureDevOpsOrg.Update update(); - - /** - * The template for AzureDevOpsOrg update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureDevOpsOrg apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureDevOpsOrg apply(Context context); - } - - /** - * The AzureDevOpsOrg update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureDevOpsOrg update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Organization properties.. - * - * @param properties Azure DevOps Organization properties. - * @return the next definition stage. - */ - Update withProperties(AzureDevOpsOrgProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureDevOpsOrg refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureDevOpsOrg refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java deleted file mode 100644 index 4c7dd6da52dab..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.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.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import java.util.List; - -/** - * An immutable client-side representation of AzureDevOpsOrgListResponse. - */ -public interface AzureDevOpsOrgListResponse { - /** - * Gets the value property: Gets or sets list of resources. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner object. - * - * @return the inner object. - */ - AzureDevOpsOrgListResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java deleted file mode 100644 index 8827c31a012f6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Azure DevOps Organization properties. - */ -@Fluent -public final class AzureDevOpsOrgProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - */ - private OnboardingState onboardingState; - - /* - * Configuration payload for PR Annotations. - */ - private ActionableRemediation actionableRemediation; - - /** - * Creates an instance of AzureDevOpsOrgProperties class. - */ - public AzureDevOpsOrgProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @return the onboardingState value. - */ - public OnboardingState onboardingState() { - return this.onboardingState; - } - - /** - * Set the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @param onboardingState the onboardingState value to set. - * @return the AzureDevOpsOrgProperties object itself. - */ - public AzureDevOpsOrgProperties withOnboardingState(OnboardingState onboardingState) { - this.onboardingState = onboardingState; - return this; - } - - /** - * Get the actionableRemediation property: Configuration payload for PR Annotations. - * - * @return the actionableRemediation value. - */ - public ActionableRemediation actionableRemediation() { - return this.actionableRemediation; - } - - /** - * Set the actionableRemediation property: Configuration payload for PR Annotations. - * - * @param actionableRemediation the actionableRemediation value to set. - * @return the AzureDevOpsOrgProperties object itself. - */ - public AzureDevOpsOrgProperties withActionableRemediation(ActionableRemediation actionableRemediation) { - this.actionableRemediation = actionableRemediation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionableRemediation() != null) { - actionableRemediation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("onboardingState", - this.onboardingState == null ? null : this.onboardingState.toString()); - jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsOrgProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsOrgProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsOrgProperties. - */ - public static AzureDevOpsOrgProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsOrgProperties deserializedAzureDevOpsOrgProperties = new AzureDevOpsOrgProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("onboardingState".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.onboardingState - = OnboardingState.fromString(reader.getString()); - } else if ("actionableRemediation".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.actionableRemediation = ActionableRemediation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsOrgProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java deleted file mode 100644 index 8da159b8e50e3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureDevOpsOrgs. - */ -public interface AzureDevOpsOrgs { - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response}. - */ - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - AzureDevOpsOrgListResponse listAvailable(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, String orgName, - Context context); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response}. - */ - AzureDevOpsOrg getById(String id); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureDevOpsOrg resource. - * - * @param name resource name. - * @return the first stage of the new AzureDevOpsOrg definition. - */ - AzureDevOpsOrg.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java deleted file mode 100644 index c8b69c7bd2278..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; - -/** - * An immutable client-side representation of AzureDevOpsProject. - */ -public interface AzureDevOpsProject { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: Azure DevOps Project properties. - * - * @return the properties value. - */ - AzureDevOpsProjectProperties properties(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner object. - * - * @return the inner object. - */ - AzureDevOpsProjectInner innerModel(); - - /** - * The entirety of the AzureDevOpsProject definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureDevOpsProject definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureDevOpsProject definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureDevOpsProject definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName, orgName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @return the next definition stage. - */ - WithCreate withExistingAzureDevOpsOrg(String resourceGroupName, String securityConnectorName, - String orgName); - } - - /** - * The stage of the AzureDevOpsProject definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureDevOpsProject create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureDevOpsProject create(Context context); - } - - /** - * The stage of the AzureDevOpsProject definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Project properties.. - * - * @param properties Azure DevOps Project properties. - * @return the next definition stage. - */ - WithCreate withProperties(AzureDevOpsProjectProperties properties); - } - } - - /** - * Begins update for the AzureDevOpsProject resource. - * - * @return the stage of resource update. - */ - AzureDevOpsProject.Update update(); - - /** - * The template for AzureDevOpsProject update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureDevOpsProject apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureDevOpsProject apply(Context context); - } - - /** - * The AzureDevOpsProject update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureDevOpsProject update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Project properties.. - * - * @param properties Azure DevOps Project properties. - * @return the next definition stage. - */ - Update withProperties(AzureDevOpsProjectProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureDevOpsProject refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureDevOpsProject refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java deleted file mode 100644 index 5f1fa3e277582..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class AzureDevOpsProjectListResponse implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of AzureDevOpsProjectListResponse class. - */ - public AzureDevOpsProjectListResponse() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the AzureDevOpsProjectListResponse object itself. - */ - public AzureDevOpsProjectListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the AzureDevOpsProjectListResponse object itself. - */ - public AzureDevOpsProjectListResponse withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsProjectListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsProjectListResponse if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsProjectListResponse. - */ - public static AzureDevOpsProjectListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsProjectListResponse deserializedAzureDevOpsProjectListResponse - = new AzureDevOpsProjectListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureDevOpsProjectInner.fromJson(reader1)); - deserializedAzureDevOpsProjectListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAzureDevOpsProjectListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsProjectListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java deleted file mode 100644 index 8fd05fbfa7c4a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Azure DevOps Project properties. - */ -@Fluent -public final class AzureDevOpsProjectProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Gets or sets parent Azure DevOps Organization name. - */ - private String parentOrgName; - - /* - * Gets or sets Azure DevOps Project id. - */ - private String projectId; - - /* - * Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - */ - private OnboardingState onboardingState; - - /* - * Configuration payload for PR Annotations. - */ - private ActionableRemediation actionableRemediation; - - /** - * Creates an instance of AzureDevOpsProjectProperties class. - */ - public AzureDevOpsProjectProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @return the parentOrgName value. - */ - public String parentOrgName() { - return this.parentOrgName; - } - - /** - * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @param parentOrgName the parentOrgName value to set. - * @return the AzureDevOpsProjectProperties object itself. - */ - public AzureDevOpsProjectProperties withParentOrgName(String parentOrgName) { - this.parentOrgName = parentOrgName; - return this; - } - - /** - * Get the projectId property: Gets or sets Azure DevOps Project id. - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Get the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @return the onboardingState value. - */ - public OnboardingState onboardingState() { - return this.onboardingState; - } - - /** - * Set the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @param onboardingState the onboardingState value to set. - * @return the AzureDevOpsProjectProperties object itself. - */ - public AzureDevOpsProjectProperties withOnboardingState(OnboardingState onboardingState) { - this.onboardingState = onboardingState; - return this; - } - - /** - * Get the actionableRemediation property: Configuration payload for PR Annotations. - * - * @return the actionableRemediation value. - */ - public ActionableRemediation actionableRemediation() { - return this.actionableRemediation; - } - - /** - * Set the actionableRemediation property: Configuration payload for PR Annotations. - * - * @param actionableRemediation the actionableRemediation value to set. - * @return the AzureDevOpsProjectProperties object itself. - */ - public AzureDevOpsProjectProperties withActionableRemediation(ActionableRemediation actionableRemediation) { - this.actionableRemediation = actionableRemediation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionableRemediation() != null) { - actionableRemediation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("parentOrgName", this.parentOrgName); - jsonWriter.writeStringField("onboardingState", - this.onboardingState == null ? null : this.onboardingState.toString()); - jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsProjectProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsProjectProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsProjectProperties. - */ - public static AzureDevOpsProjectProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsProjectProperties deserializedAzureDevOpsProjectProperties = new AzureDevOpsProjectProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("parentOrgName".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.parentOrgName = reader.getString(); - } else if ("projectId".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.projectId = reader.getString(); - } else if ("onboardingState".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.onboardingState - = OnboardingState.fromString(reader.getString()); - } else if ("actionableRemediation".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.actionableRemediation - = ActionableRemediation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsProjectProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java deleted file mode 100644 index 2b5f0629348a4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.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.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureDevOpsProjects. - */ -public interface AzureDevOpsProjects { - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - AzureDevOpsProject get(String resourceGroupName, String securityConnectorName, String orgName, String projectName); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response}. - */ - AzureDevOpsProject getById(String id); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureDevOpsProject resource. - * - * @param name resource name. - * @return the first stage of the new AzureDevOpsProject definition. - */ - AzureDevOpsProject.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java deleted file mode 100644 index 65f560c6266d6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureDevOpsRepos. - */ -public interface AzureDevOpsRepos { - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - String projectName); - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @param repoName The repository name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - AzureDevOpsRepository get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response}. - */ - AzureDevOpsRepository getById(String id); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureDevOpsRepository resource. - * - * @param name resource name. - * @return the first stage of the new AzureDevOpsRepository definition. - */ - AzureDevOpsRepository.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java deleted file mode 100644 index 7c3114d7c2724..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; - -/** - * An immutable client-side representation of AzureDevOpsRepository. - */ -public interface AzureDevOpsRepository { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: Azure DevOps Repository properties. - * - * @return the properties value. - */ - AzureDevOpsRepositoryProperties properties(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner object. - * - * @return the inner object. - */ - AzureDevOpsRepositoryInner innerModel(); - - /** - * The entirety of the AzureDevOpsRepository definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureDevOpsRepository definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureDevOpsRepository definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureDevOpsRepository definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName, orgName, projectName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The Azure DevOps organization name. - * @param projectName The project name. - * @return the next definition stage. - */ - WithCreate withExistingProject(String resourceGroupName, String securityConnectorName, String orgName, - String projectName); - } - - /** - * The stage of the AzureDevOpsRepository definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureDevOpsRepository create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureDevOpsRepository create(Context context); - } - - /** - * The stage of the AzureDevOpsRepository definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Repository properties.. - * - * @param properties Azure DevOps Repository properties. - * @return the next definition stage. - */ - WithCreate withProperties(AzureDevOpsRepositoryProperties properties); - } - } - - /** - * Begins update for the AzureDevOpsRepository resource. - * - * @return the stage of resource update. - */ - AzureDevOpsRepository.Update update(); - - /** - * The template for AzureDevOpsRepository update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureDevOpsRepository apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureDevOpsRepository apply(Context context); - } - - /** - * The AzureDevOpsRepository update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureDevOpsRepository update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Repository properties.. - * - * @param properties Azure DevOps Repository properties. - * @return the next definition stage. - */ - Update withProperties(AzureDevOpsRepositoryProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureDevOpsRepository refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureDevOpsRepository refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java deleted file mode 100644 index eb3a14b095b90..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class AzureDevOpsRepositoryListResponse implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of AzureDevOpsRepositoryListResponse class. - */ - public AzureDevOpsRepositoryListResponse() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the AzureDevOpsRepositoryListResponse object itself. - */ - public AzureDevOpsRepositoryListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the AzureDevOpsRepositoryListResponse object itself. - */ - public AzureDevOpsRepositoryListResponse withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsRepositoryListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsRepositoryListResponse if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsRepositoryListResponse. - */ - public static AzureDevOpsRepositoryListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsRepositoryListResponse deserializedAzureDevOpsRepositoryListResponse - = new AzureDevOpsRepositoryListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureDevOpsRepositoryInner.fromJson(reader1)); - deserializedAzureDevOpsRepositoryListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAzureDevOpsRepositoryListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsRepositoryListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java deleted file mode 100644 index 391a5e339578b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Azure DevOps Repository properties. - */ -@Fluent -public final class AzureDevOpsRepositoryProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Gets or sets parent Azure DevOps Organization name. - */ - private String parentOrgName; - - /* - * Gets or sets parent Azure DevOps Project name. - */ - private String parentProjectName; - - /* - * Gets or sets Azure DevOps Repository id. - */ - private String repoId; - - /* - * Gets or sets Azure DevOps Repository url. - */ - private String repoUrl; - - /* - * Gets or sets Azure DevOps repository visibility, whether it is public or private etc. - */ - private String visibility; - - /* - * Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - */ - private OnboardingState onboardingState; - - /* - * Configuration payload for PR Annotations. - */ - private ActionableRemediation actionableRemediation; - - /** - * Creates an instance of AzureDevOpsRepositoryProperties class. - */ - public AzureDevOpsRepositoryProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @return the parentOrgName value. - */ - public String parentOrgName() { - return this.parentOrgName; - } - - /** - * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @param parentOrgName the parentOrgName value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withParentOrgName(String parentOrgName) { - this.parentOrgName = parentOrgName; - return this; - } - - /** - * Get the parentProjectName property: Gets or sets parent Azure DevOps Project name. - * - * @return the parentProjectName value. - */ - public String parentProjectName() { - return this.parentProjectName; - } - - /** - * Set the parentProjectName property: Gets or sets parent Azure DevOps Project name. - * - * @param parentProjectName the parentProjectName value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withParentProjectName(String parentProjectName) { - this.parentProjectName = parentProjectName; - return this; - } - - /** - * Get the repoId property: Gets or sets Azure DevOps Repository id. - * - * @return the repoId value. - */ - public String repoId() { - return this.repoId; - } - - /** - * Get the repoUrl property: Gets or sets Azure DevOps Repository url. - * - * @return the repoUrl value. - */ - public String repoUrl() { - return this.repoUrl; - } - - /** - * Get the visibility property: Gets or sets Azure DevOps repository visibility, whether it is public or private - * etc. - * - * @return the visibility value. - */ - public String visibility() { - return this.visibility; - } - - /** - * Get the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @return the onboardingState value. - */ - public OnboardingState onboardingState() { - return this.onboardingState; - } - - /** - * Set the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @param onboardingState the onboardingState value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withOnboardingState(OnboardingState onboardingState) { - this.onboardingState = onboardingState; - return this; - } - - /** - * Get the actionableRemediation property: Configuration payload for PR Annotations. - * - * @return the actionableRemediation value. - */ - public ActionableRemediation actionableRemediation() { - return this.actionableRemediation; - } - - /** - * Set the actionableRemediation property: Configuration payload for PR Annotations. - * - * @param actionableRemediation the actionableRemediation value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withActionableRemediation(ActionableRemediation actionableRemediation) { - this.actionableRemediation = actionableRemediation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionableRemediation() != null) { - actionableRemediation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("parentOrgName", this.parentOrgName); - jsonWriter.writeStringField("parentProjectName", this.parentProjectName); - jsonWriter.writeStringField("onboardingState", - this.onboardingState == null ? null : this.onboardingState.toString()); - jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsRepositoryProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsRepositoryProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsRepositoryProperties. - */ - public static AzureDevOpsRepositoryProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsRepositoryProperties deserializedAzureDevOpsRepositoryProperties - = new AzureDevOpsRepositoryProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("parentOrgName".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.parentOrgName = reader.getString(); - } else if ("parentProjectName".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.parentProjectName = reader.getString(); - } else if ("repoId".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.repoId = reader.getString(); - } else if ("repoUrl".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.repoUrl = reader.getString(); - } else if ("visibility".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.visibility = reader.getString(); - } else if ("onboardingState".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.onboardingState - = OnboardingState.fromString(reader.getString()); - } else if ("actionableRemediation".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.actionableRemediation - = ActionableRemediation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsRepositoryProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java deleted file mode 100644 index 1db212ca077bc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AzureDevOps scope connector's environment data. - */ -@Immutable -public final class AzureDevOpsScopeEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.AZURE_DEV_OPS_SCOPE; - - /** - * Creates an instance of AzureDevOpsScopeEnvironmentData class. - */ - public AzureDevOpsScopeEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsScopeEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsScopeEnvironmentData if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureDevOpsScopeEnvironmentData. - */ - public static AzureDevOpsScopeEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsScopeEnvironmentData deserializedAzureDevOpsScopeEnvironmentData - = new AzureDevOpsScopeEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedAzureDevOpsScopeEnvironmentData.environmentType - = EnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsScopeEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java deleted file mode 100644 index 98f019768ba48..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Describes an Azure resource with location. - */ -@Fluent -public class AzureTrackedResourceLocation implements JsonSerializable { - /* - * Location where the resource is stored - */ - private String location; - - /** - * Creates an instance of AzureTrackedResourceLocation class. - */ - public AzureTrackedResourceLocation() { - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location where the resource is stored. - * - * @param location the location value to set. - * @return the AzureTrackedResourceLocation object itself. - */ - public AzureTrackedResourceLocation withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureTrackedResourceLocation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureTrackedResourceLocation if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureTrackedResourceLocation. - */ - public static AzureTrackedResourceLocation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureTrackedResourceLocation deserializedAzureTrackedResourceLocation = new AzureTrackedResourceLocation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("location".equals(fieldName)) { - deserializedAzureTrackedResourceLocation.location = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureTrackedResourceLocation; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java deleted file mode 100644 index d37d31a3ef702..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Baseline details. - */ -@Fluent -public final class Baseline implements JsonSerializable { - /* - * Expected results. - */ - private List> expectedResults; - - /* - * Baseline update time (UTC). - */ - private OffsetDateTime updatedTime; - - /** - * Creates an instance of Baseline class. - */ - public Baseline() { - } - - /** - * Get the expectedResults property: Expected results. - * - * @return the expectedResults value. - */ - public List> expectedResults() { - return this.expectedResults; - } - - /** - * Set the expectedResults property: Expected results. - * - * @param expectedResults the expectedResults value to set. - * @return the Baseline object itself. - */ - public Baseline withExpectedResults(List> expectedResults) { - this.expectedResults = expectedResults; - return this; - } - - /** - * Get the updatedTime property: Baseline update time (UTC). - * - * @return the updatedTime value. - */ - public OffsetDateTime updatedTime() { - return this.updatedTime; - } - - /** - * Set the updatedTime property: Baseline update time (UTC). - * - * @param updatedTime the updatedTime value to set. - * @return the Baseline object itself. - */ - public Baseline withUpdatedTime(OffsetDateTime updatedTime) { - this.updatedTime = updatedTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("expectedResults", this.expectedResults, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeStringField("updatedTime", - this.updatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Baseline from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Baseline if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IOException If an error occurs while reading the Baseline. - */ - public static Baseline fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Baseline deserializedBaseline = new Baseline(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("expectedResults".equals(fieldName)) { - List> expectedResults - = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedBaseline.expectedResults = expectedResults; - } else if ("updatedTime".equals(fieldName)) { - deserializedBaseline.updatedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedBaseline; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java deleted file mode 100644 index 910e46c1aec0d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The rule result adjusted with baseline. - */ -@Fluent -public final class BaselineAdjustedResult implements JsonSerializable { - /* - * Baseline details. - */ - private Baseline baseline; - - /* - * The rule result status. - */ - private RuleStatus status; - - /* - * Results the are not in baseline. - */ - private List> resultsNotInBaseline; - - /* - * Results the are in baseline. - */ - private List> resultsOnlyInBaseline; - - /** - * Creates an instance of BaselineAdjustedResult class. - */ - public BaselineAdjustedResult() { - } - - /** - * Get the baseline property: Baseline details. - * - * @return the baseline value. - */ - public Baseline baseline() { - return this.baseline; - } - - /** - * Set the baseline property: Baseline details. - * - * @param baseline the baseline value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withBaseline(Baseline baseline) { - this.baseline = baseline; - return this; - } - - /** - * Get the status property: The rule result status. - * - * @return the status value. - */ - public RuleStatus status() { - return this.status; - } - - /** - * Set the status property: The rule result status. - * - * @param status the status value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withStatus(RuleStatus status) { - this.status = status; - return this; - } - - /** - * Get the resultsNotInBaseline property: Results the are not in baseline. - * - * @return the resultsNotInBaseline value. - */ - public List> resultsNotInBaseline() { - return this.resultsNotInBaseline; - } - - /** - * Set the resultsNotInBaseline property: Results the are not in baseline. - * - * @param resultsNotInBaseline the resultsNotInBaseline value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withResultsNotInBaseline(List> resultsNotInBaseline) { - this.resultsNotInBaseline = resultsNotInBaseline; - return this; - } - - /** - * Get the resultsOnlyInBaseline property: Results the are in baseline. - * - * @return the resultsOnlyInBaseline value. - */ - public List> resultsOnlyInBaseline() { - return this.resultsOnlyInBaseline; - } - - /** - * Set the resultsOnlyInBaseline property: Results the are in baseline. - * - * @param resultsOnlyInBaseline the resultsOnlyInBaseline value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withResultsOnlyInBaseline(List> resultsOnlyInBaseline) { - this.resultsOnlyInBaseline = resultsOnlyInBaseline; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (baseline() != null) { - baseline().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("baseline", this.baseline); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeArrayField("resultsNotInBaseline", this.resultsNotInBaseline, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeArrayField("resultsOnlyInBaseline", this.resultsOnlyInBaseline, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BaselineAdjustedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BaselineAdjustedResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the BaselineAdjustedResult. - */ - public static BaselineAdjustedResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BaselineAdjustedResult deserializedBaselineAdjustedResult = new BaselineAdjustedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("baseline".equals(fieldName)) { - deserializedBaselineAdjustedResult.baseline = Baseline.fromJson(reader); - } else if ("status".equals(fieldName)) { - deserializedBaselineAdjustedResult.status = RuleStatus.fromString(reader.getString()); - } else if ("resultsNotInBaseline".equals(fieldName)) { - List> resultsNotInBaseline - = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedBaselineAdjustedResult.resultsNotInBaseline = resultsNotInBaseline; - } else if ("resultsOnlyInBaseline".equals(fieldName)) { - List> resultsOnlyInBaseline - = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedBaselineAdjustedResult.resultsOnlyInBaseline = resultsOnlyInBaseline; - } else { - reader.skipChildren(); - } - } - - return deserializedBaselineAdjustedResult; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java deleted file mode 100644 index c51fdc59c1b2a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The benchmark references. - */ -@Fluent -public final class BenchmarkReference implements JsonSerializable { - /* - * The benchmark name. - */ - private String benchmark; - - /* - * The benchmark reference. - */ - private String reference; - - /** - * Creates an instance of BenchmarkReference class. - */ - public BenchmarkReference() { - } - - /** - * Get the benchmark property: The benchmark name. - * - * @return the benchmark value. - */ - public String benchmark() { - return this.benchmark; - } - - /** - * Set the benchmark property: The benchmark name. - * - * @param benchmark the benchmark value to set. - * @return the BenchmarkReference object itself. - */ - public BenchmarkReference withBenchmark(String benchmark) { - this.benchmark = benchmark; - return this; - } - - /** - * Get the reference property: The benchmark reference. - * - * @return the reference value. - */ - public String reference() { - return this.reference; - } - - /** - * Set the reference property: The benchmark reference. - * - * @param reference the reference value to set. - * @return the BenchmarkReference object itself. - */ - public BenchmarkReference withReference(String reference) { - this.reference = reference; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("benchmark", this.benchmark); - jsonWriter.writeStringField("reference", this.reference); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BenchmarkReference from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BenchmarkReference if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the BenchmarkReference. - */ - public static BenchmarkReference fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BenchmarkReference deserializedBenchmarkReference = new BenchmarkReference(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("benchmark".equals(fieldName)) { - deserializedBenchmarkReference.benchmark = reader.getString(); - } else if ("reference".equals(fieldName)) { - deserializedBenchmarkReference.reference = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBenchmarkReference; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java deleted file mode 100644 index 139e6fdbc0fd1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A summary of the scan results of the blobs that were scanned. - */ -@Fluent -public final class BlobsScanSummary implements JsonSerializable { - /* - * The total number of blobs that were scanned. - */ - private Long totalBlobsScanned; - - /* - * The number of malicious blobs that were detected during the scan. - */ - private Long maliciousBlobsCount; - - /* - * The number of blobs that were skipped. - */ - private Long skippedBlobsCount; - - /* - * The number of gigabytes of data that were scanned. - */ - private Double scannedBlobsInGB; - - /** - * Creates an instance of BlobsScanSummary class. - */ - public BlobsScanSummary() { - } - - /** - * Get the totalBlobsScanned property: The total number of blobs that were scanned. - * - * @return the totalBlobsScanned value. - */ - public Long totalBlobsScanned() { - return this.totalBlobsScanned; - } - - /** - * Set the totalBlobsScanned property: The total number of blobs that were scanned. - * - * @param totalBlobsScanned the totalBlobsScanned value to set. - * @return the BlobsScanSummary object itself. - */ - public BlobsScanSummary withTotalBlobsScanned(Long totalBlobsScanned) { - this.totalBlobsScanned = totalBlobsScanned; - return this; - } - - /** - * Get the maliciousBlobsCount property: The number of malicious blobs that were detected during the scan. - * - * @return the maliciousBlobsCount value. - */ - public Long maliciousBlobsCount() { - return this.maliciousBlobsCount; - } - - /** - * Set the maliciousBlobsCount property: The number of malicious blobs that were detected during the scan. - * - * @param maliciousBlobsCount the maliciousBlobsCount value to set. - * @return the BlobsScanSummary object itself. - */ - public BlobsScanSummary withMaliciousBlobsCount(Long maliciousBlobsCount) { - this.maliciousBlobsCount = maliciousBlobsCount; - return this; - } - - /** - * Get the skippedBlobsCount property: The number of blobs that were skipped. - * - * @return the skippedBlobsCount value. - */ - public Long skippedBlobsCount() { - return this.skippedBlobsCount; - } - - /** - * Set the skippedBlobsCount property: The number of blobs that were skipped. - * - * @param skippedBlobsCount the skippedBlobsCount value to set. - * @return the BlobsScanSummary object itself. - */ - public BlobsScanSummary withSkippedBlobsCount(Long skippedBlobsCount) { - this.skippedBlobsCount = skippedBlobsCount; - return this; - } - - /** - * Get the scannedBlobsInGB property: The number of gigabytes of data that were scanned. - * - * @return the scannedBlobsInGB value. - */ - public Double scannedBlobsInGB() { - return this.scannedBlobsInGB; - } - - /** - * Set the scannedBlobsInGB property: The number of gigabytes of data that were scanned. - * - * @param scannedBlobsInGB the scannedBlobsInGB value to set. - * @return the BlobsScanSummary object itself. - */ - public BlobsScanSummary withScannedBlobsInGB(Double scannedBlobsInGB) { - this.scannedBlobsInGB = scannedBlobsInGB; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("totalBlobsScanned", this.totalBlobsScanned); - jsonWriter.writeNumberField("maliciousBlobsCount", this.maliciousBlobsCount); - jsonWriter.writeNumberField("skippedBlobsCount", this.skippedBlobsCount); - jsonWriter.writeNumberField("scannedBlobsInGB", this.scannedBlobsInGB); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BlobsScanSummary from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BlobsScanSummary if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the BlobsScanSummary. - */ - public static BlobsScanSummary fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BlobsScanSummary deserializedBlobsScanSummary = new BlobsScanSummary(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("totalBlobsScanned".equals(fieldName)) { - deserializedBlobsScanSummary.totalBlobsScanned = reader.getNullable(JsonReader::getLong); - } else if ("maliciousBlobsCount".equals(fieldName)) { - deserializedBlobsScanSummary.maliciousBlobsCount = reader.getNullable(JsonReader::getLong); - } else if ("skippedBlobsCount".equals(fieldName)) { - deserializedBlobsScanSummary.skippedBlobsCount = reader.getNullable(JsonReader::getLong); - } else if ("scannedBlobsInGB".equals(fieldName)) { - deserializedBlobsScanSummary.scannedBlobsInGB = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedBlobsScanSummary; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java deleted file mode 100644 index 876c026eb963d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Objects; -import java.util.UUID; - -/** - * Pre-configured sensitive information type. - */ -@Fluent -public final class BuiltInInfoType implements JsonSerializable { - /* - * Display name of the info type - */ - private String name; - - /* - * Id of the info type - */ - private UUID id; - - /* - * Category of the built-in info type - */ - private String type; - - /** - * Creates an instance of BuiltInInfoType class. - */ - public BuiltInInfoType() { - } - - /** - * Get the name property: Display name of the info type. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Display name of the info type. - * - * @param name the name value to set. - * @return the BuiltInInfoType object itself. - */ - public BuiltInInfoType withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: Id of the info type. - * - * @return the id value. - */ - public UUID id() { - return this.id; - } - - /** - * Set the id property: Id of the info type. - * - * @param id the id value to set. - * @return the BuiltInInfoType object itself. - */ - public BuiltInInfoType withId(UUID id) { - this.id = id; - return this; - } - - /** - * Get the type property: Category of the built-in info type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Category of the built-in info type. - * - * @param type the type value to set. - * @return the BuiltInInfoType object itself. - */ - public BuiltInInfoType withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("id", Objects.toString(this.id, null)); - jsonWriter.writeStringField("type", this.type); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BuiltInInfoType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BuiltInInfoType if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the BuiltInInfoType. - */ - public static BuiltInInfoType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BuiltInInfoType deserializedBuiltInInfoType = new BuiltInInfoType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedBuiltInInfoType.name = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedBuiltInInfoType.id - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("type".equals(fieldName)) { - deserializedBuiltInInfoType.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBuiltInInfoType; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java deleted file mode 100644 index b52a6f04d65c8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Severity level per category configuration for PR Annotations. - */ -@Fluent -public final class CategoryConfiguration implements JsonSerializable { - /* - * Gets or sets minimum severity level for a given category. - */ - private String minimumSeverityLevel; - - /* - * Rule categories. - * Code - code scanning results. - * Artifact scanning results. - * Dependencies scanning results. - * IaC results. - * Secrets scanning results. - * Container scanning results. - */ - private RuleCategory category; - - /** - * Creates an instance of CategoryConfiguration class. - */ - public CategoryConfiguration() { - } - - /** - * Get the minimumSeverityLevel property: Gets or sets minimum severity level for a given category. - * - * @return the minimumSeverityLevel value. - */ - public String minimumSeverityLevel() { - return this.minimumSeverityLevel; - } - - /** - * Set the minimumSeverityLevel property: Gets or sets minimum severity level for a given category. - * - * @param minimumSeverityLevel the minimumSeverityLevel value to set. - * @return the CategoryConfiguration object itself. - */ - public CategoryConfiguration withMinimumSeverityLevel(String minimumSeverityLevel) { - this.minimumSeverityLevel = minimumSeverityLevel; - return this; - } - - /** - * Get the category property: Rule categories. - * Code - code scanning results. - * Artifact scanning results. - * Dependencies scanning results. - * IaC results. - * Secrets scanning results. - * Container scanning results. - * - * @return the category value. - */ - public RuleCategory category() { - return this.category; - } - - /** - * Set the category property: Rule categories. - * Code - code scanning results. - * Artifact scanning results. - * Dependencies scanning results. - * IaC results. - * Secrets scanning results. - * Container scanning results. - * - * @param category the category value to set. - * @return the CategoryConfiguration object itself. - */ - public CategoryConfiguration withCategory(RuleCategory category) { - this.category = category; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("minimumSeverityLevel", this.minimumSeverityLevel); - jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CategoryConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CategoryConfiguration if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the CategoryConfiguration. - */ - public static CategoryConfiguration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CategoryConfiguration deserializedCategoryConfiguration = new CategoryConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("minimumSeverityLevel".equals(fieldName)) { - deserializedCategoryConfiguration.minimumSeverityLevel = reader.getString(); - } else if ("category".equals(fieldName)) { - deserializedCategoryConfiguration.category = RuleCategory.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCategoryConfiguration; - }); - } -} 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 deleted file mode 100644 index f9a67c24f3f2c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The multi cloud resource's cloud name. - */ -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"); - - /** - * Static value Github for CloudName. - */ - public static final CloudName GITHUB = fromString("Github"); - - /** - * Static value AzureDevOps for CloudName. - */ - public static final CloudName AZURE_DEV_OPS = fromString("AzureDevOps"); - - /** - * Static value GitLab for CloudName. - */ - public static final CloudName GIT_LAB = fromString("GitLab"); - - /** - * Static value DockerHub for CloudName. - */ - public static final CloudName DOCKER_HUB = fromString("DockerHub"); - - /** - * Static value JFrog for CloudName. - */ - public static final CloudName JFROG = fromString("JFrog"); - - /** - * Creates a new instance of CloudName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CloudName() { - } - - /** - * Creates or finds a CloudName from its string representation. - * - * @param name a name to look for. - * @return the corresponding CloudName. - */ - public static CloudName fromString(String name) { - return fromString(name, CloudName.class); - } - - /** - * Gets known CloudName values. - * - * @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 deleted file mode 100644 index d6ca882517984..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The security offering details. - */ -@Immutable -public class CloudOffering implements JsonSerializable { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.fromString("CloudOffering"); - - /* - * The offering description. - */ - private String description; - - /** - * Creates an instance of CloudOffering class. - */ - public CloudOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the description property: The offering description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The offering description. - * - * @param description the description value to set. - * @return the CloudOffering object itself. - */ - CloudOffering withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudOffering if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the CloudOffering. - */ - public static CloudOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("offeringType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("CspmMonitorAws".equals(discriminatorValue)) { - return CspmMonitorAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersAws".equals(discriminatorValue)) { - return DefenderForContainersAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForServersAws".equals(discriminatorValue)) { - return DefenderForServersAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForDatabasesAws".equals(discriminatorValue)) { - return DefenderFoDatabasesAwsOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorGcp".equals(discriminatorValue)) { - return CspmMonitorGcpOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForServersGcp".equals(discriminatorValue)) { - return DefenderForServersGcpOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForDatabasesGcp".equals(discriminatorValue)) { - return DefenderForDatabasesGcpOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersGcp".equals(discriminatorValue)) { - return DefenderForContainersGcpOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorGithub".equals(discriminatorValue)) { - return CspmMonitorGithubOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorAzureDevOps".equals(discriminatorValue)) { - return CspmMonitorAzureDevOpsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmAws".equals(discriminatorValue)) { - return DefenderCspmAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmGcp".equals(discriminatorValue)) { - return DefenderCspmGcpOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorGitLab".equals(discriminatorValue)) { - return CspmMonitorGitLabOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorDockerHub".equals(discriminatorValue)) { - return CspmMonitorDockerHubOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersDockerHub".equals(discriminatorValue)) { - return DefenderForContainersDockerHubOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmDockerHub".equals(discriminatorValue)) { - return DefenderCspmDockerHubOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorJFrog".equals(discriminatorValue)) { - return CspmMonitorJFrogOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersJFrog".equals(discriminatorValue)) { - return DefenderForContainersJFrogOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmJFrog".equals(discriminatorValue)) { - return DefenderCspmJFrogOffering.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static CloudOffering fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudOffering deserializedCloudOffering = new CloudOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("offeringType".equals(fieldName)) { - deserializedCloudOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedCloudOffering.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java deleted file mode 100644 index 01358544b4d42..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of Compliance. - */ -public interface Compliance { - /** - * 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 assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - OffsetDateTime assessmentTimestampUtcDate(); - - /** - * Gets 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. - */ - Integer resourceCount(); - - /** - * Gets the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - List assessmentResult(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ComplianceInner object. - * - * @return the inner object. - */ - ComplianceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java deleted file mode 100644 index 009d7add85ea4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import java.io.IOException; -import java.util.List; - -/** - * List of Compliance objects response. - */ -@Fluent -public final class ComplianceList implements JsonSerializable { - /* - * List of Compliance objects - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of ComplianceList class. - */ - public ComplianceList() { - } - - /** - * Get the value property: List of Compliance objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Compliance objects. - * - * @param value the value value to set. - * @return the ComplianceList object itself. - */ - public ComplianceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComplianceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceList if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ComplianceList. - */ - public static ComplianceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceList deserializedComplianceList = new ComplianceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ComplianceInner.fromJson(reader1)); - deserializedComplianceList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedComplianceList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java deleted file mode 100644 index 2d1131f322e35..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A segment of a compliance assessment. - */ -@Immutable -public final class ComplianceSegment implements JsonSerializable { - /* - * The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - */ - private String segmentType; - - /* - * The size (%) of the segment. - */ - private Double percentage; - - /** - * Creates an instance of ComplianceSegment class. - */ - public ComplianceSegment() { - } - - /** - * Get the segmentType property: The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - * - * @return the segmentType value. - */ - public String segmentType() { - return this.segmentType; - } - - /** - * Get the percentage property: The size (%) of the segment. - * - * @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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComplianceSegment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceSegment if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ComplianceSegment. - */ - public static ComplianceSegment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceSegment deserializedComplianceSegment = new ComplianceSegment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("segmentType".equals(fieldName)) { - deserializedComplianceSegment.segmentType = reader.getString(); - } else if ("percentage".equals(fieldName)) { - deserializedComplianceSegment.percentage = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceSegment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java deleted file mode 100644 index 9bc6c3f347e12..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.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.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Compliances. - */ -public interface Compliances { - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - Response getWithResponse(String scope, String complianceName, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - Compliance get(String scope, String complianceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java deleted file mode 100644 index 0542d4b9ef658..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (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.ConnectorSettingInner; - -/** - * An immutable client-side representation of ConnectorSetting. - */ -public interface ConnectorSetting { - /** - * 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 hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). - * - * @return the hybridComputeSettings value. - */ - HybridComputeSettingsProperties hybridComputeSettings(); - - /** - * Gets the authenticationDetails property: Settings for authentication management, these settings are relevant only - * for the cloud connector. - * - * @return the authenticationDetails value. - */ - AuthenticationDetailsProperties authenticationDetails(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner object. - * - * @return the inner object. - */ - ConnectorSettingInner innerModel(); - - /** - * The entirety of the ConnectorSetting definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** - * The ConnectorSetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ConnectorSetting definition. - */ - interface Blank extends WithCreate { - } - - /** - * The stage of the ConnectorSetting definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithHybridComputeSettings, DefinitionStages.WithAuthenticationDetails { - /** - * Executes the create request. - * - * @return the created resource. - */ - ConnectorSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ConnectorSetting create(Context context); - } - - /** - * The stage of the ConnectorSetting definition allowing to specify hybridComputeSettings. - */ - interface WithHybridComputeSettings { - /** - * Specifies the hybridComputeSettings property: Settings for hybrid compute management. These settings are - * relevant only for Arc autoProvision (Hybrid Compute).. - * - * @param hybridComputeSettings Settings for hybrid compute management. These settings are relevant only for - * Arc autoProvision (Hybrid Compute). - * @return the next definition stage. - */ - WithCreate withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); - } - - /** - * The stage of the ConnectorSetting definition allowing to specify authenticationDetails. - */ - interface WithAuthenticationDetails { - /** - * Specifies the authenticationDetails property: Settings for authentication management, these settings are - * relevant only for the cloud connector.. - * - * @param authenticationDetails Settings for authentication management, these settings are relevant only for - * the cloud connector. - * @return the next definition stage. - */ - WithCreate withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); - } - } - - /** - * Begins update for the ConnectorSetting resource. - * - * @return the stage of resource update. - */ - ConnectorSetting.Update update(); - - /** - * The template for ConnectorSetting update. - */ - interface Update extends UpdateStages.WithHybridComputeSettings, UpdateStages.WithAuthenticationDetails { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ConnectorSetting apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ConnectorSetting apply(Context context); - } - - /** - * The ConnectorSetting update stages. - */ - interface UpdateStages { - /** - * The stage of the ConnectorSetting update allowing to specify hybridComputeSettings. - */ - interface WithHybridComputeSettings { - /** - * Specifies the hybridComputeSettings property: Settings for hybrid compute management. These settings are - * relevant only for Arc autoProvision (Hybrid Compute).. - * - * @param hybridComputeSettings Settings for hybrid compute management. These settings are relevant only for - * Arc autoProvision (Hybrid Compute). - * @return the next definition stage. - */ - Update withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); - } - - /** - * The stage of the ConnectorSetting update allowing to specify authenticationDetails. - */ - interface WithAuthenticationDetails { - /** - * Specifies the authenticationDetails property: Settings for authentication management, these settings are - * relevant only for the cloud connector.. - * - * @param authenticationDetails Settings for authentication management, these settings are relevant only for - * the cloud connector. - * @return the next definition stage. - */ - Update withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ConnectorSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ConnectorSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java deleted file mode 100644 index 38abef3717a73..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import java.io.IOException; -import java.util.List; - -/** - * For a subscription, list of all cloud account connectors and their settings. - */ -@Fluent -public final class ConnectorSettingList implements JsonSerializable { - /* - * List of all the cloud account connector settings - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of ConnectorSettingList class. - */ - public ConnectorSettingList() { - } - - /** - * Get the value property: List of all the cloud account connector settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of all the cloud account connector settings. - * - * @param value the value value to set. - * @return the ConnectorSettingList object itself. - */ - public ConnectorSettingList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectorSettingList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectorSettingList if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ConnectorSettingList. - */ - public static ConnectorSettingList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectorSettingList deserializedConnectorSettingList = new ConnectorSettingList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ConnectorSettingInner.fromJson(reader1)); - deserializedConnectorSettingList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedConnectorSettingList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectorSettingList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java deleted file mode 100644 index 1d72270a40bd6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.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.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 Connectors. - */ -public interface Connectors { - /** - * Cloud accounts connectors of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Cloud accounts connectors of a 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - Response getWithResponse(String connectorName, Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - ConnectorSetting get(String connectorName); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String connectorName, Context context); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 connectorName); - - /** - * Details of a specific cloud account connector. - * - * @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 connector setting along with {@link Response}. - */ - ConnectorSetting getById(String id); - - /** - * Details of a specific cloud account connector. - * - * @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 connector setting along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a cloud account connector from a 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 cloud account connector from a subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ConnectorSetting resource. - * - * @param name resource name. - * @return the first stage of the new ConnectorSetting definition. - */ - ConnectorSetting.DefinitionStages.Blank define(String name); -} 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 deleted file mode 100644 index 8e0819e44c6b0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * Additional context fields for container registry Vulnerability assessment. - */ -@Immutable -public final class ContainerRegistryVulnerabilityProperties extends AdditionalData { - /* - * Sub-assessment resource type - */ - private AssessedResourceType assessedResourceType = AssessedResourceType.CONTAINER_REGISTRY_VULNERABILITY; - - /* - * Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability - */ - private String type; - - /* - * Dictionary from cvss version to cvss details object - */ - private Map cvss; - - /* - * Indicates whether a patch is available or not - */ - private Boolean patchable; - - /* - * List of CVEs - */ - private List cve; - - /* - * Published time - */ - private OffsetDateTime publishedTime; - - /* - * The vendorReferences property. - */ - private List vendorReferences; - - /* - * Name of the repository which the vulnerable image belongs to - */ - private String repositoryName; - - /* - * Digest of the vulnerable image - */ - private String imageDigest; - - /** - * Creates an instance of ContainerRegistryVulnerabilityProperties class. - */ - public ContainerRegistryVulnerabilityProperties() { - } - - /** - * Get the assessedResourceType property: Sub-assessment resource type. - * - * @return the assessedResourceType value. - */ - @Override - public AssessedResourceType assessedResourceType() { - return this.assessedResourceType; - } - - /** - * Get the type property: Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, - * Vulnerability. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the cvss property: Dictionary from cvss version to cvss details object. - * - * @return the cvss value. - */ - public Map cvss() { - return this.cvss; - } - - /** - * Get the patchable property: Indicates whether a patch is available or not. - * - * @return the patchable value. - */ - public Boolean patchable() { - return this.patchable; - } - - /** - * Get the cve property: List of CVEs. - * - * @return the cve value. - */ - public List cve() { - return this.cve; - } - - /** - * Get the publishedTime property: Published time. - * - * @return the publishedTime value. - */ - public OffsetDateTime publishedTime() { - return this.publishedTime; - } - - /** - * Get the vendorReferences property: The vendorReferences property. - * - * @return the vendorReferences value. - */ - public List vendorReferences() { - return this.vendorReferences; - } - - /** - * Get the repositoryName property: Name of the repository which the vulnerable image belongs to. - * - * @return the repositoryName value. - */ - public String repositoryName() { - return this.repositoryName; - } - - /** - * Get the imageDigest property: Digest of the vulnerable image. - * - * @return the imageDigest value. - */ - public String imageDigest() { - return this.imageDigest; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (cvss() != null) { - cvss().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (cve() != null) { - cve().forEach(e -> e.validate()); - } - if (vendorReferences() != null) { - vendorReferences().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assessedResourceType", - this.assessedResourceType == null ? null : this.assessedResourceType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ContainerRegistryVulnerabilityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ContainerRegistryVulnerabilityProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ContainerRegistryVulnerabilityProperties. - */ - public static ContainerRegistryVulnerabilityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ContainerRegistryVulnerabilityProperties deserializedContainerRegistryVulnerabilityProperties - = new ContainerRegistryVulnerabilityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessedResourceType".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.assessedResourceType - = AssessedResourceType.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.type = reader.getString(); - } else if ("cvss".equals(fieldName)) { - Map cvss = reader.readMap(reader1 -> Cvss.fromJson(reader1)); - deserializedContainerRegistryVulnerabilityProperties.cvss = cvss; - } else if ("patchable".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.patchable - = reader.getNullable(JsonReader::getBoolean); - } else if ("cve".equals(fieldName)) { - List cve = reader.readArray(reader1 -> Cve.fromJson(reader1)); - deserializedContainerRegistryVulnerabilityProperties.cve = cve; - } else if ("publishedTime".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.publishedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("vendorReferences".equals(fieldName)) { - List vendorReferences - = reader.readArray(reader1 -> VendorReference.fromJson(reader1)); - deserializedContainerRegistryVulnerabilityProperties.vendorReferences = vendorReferences; - } else if ("repositoryName".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.repositoryName = reader.getString(); - } else if ("imageDigest".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.imageDigest = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedContainerRegistryVulnerabilityProperties; - }); - } -} 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 deleted file mode 100644 index 0a688baca65fb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for AWS offering. - */ -@Fluent -public final class CspmMonitorAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_AWS; - - /* - * The native cloud connection configuration - */ - private CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection; - - /** - * Creates an instance of CspmMonitorAwsOffering class. - */ - public CspmMonitorAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * 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() { - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("nativeCloudConnection", this.nativeCloudConnection); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorAwsOffering if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorAwsOffering. - */ - public static CspmMonitorAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorAwsOffering deserializedCspmMonitorAwsOffering = new CspmMonitorAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorAwsOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("nativeCloudConnection".equals(fieldName)) { - deserializedCspmMonitorAwsOffering.nativeCloudConnection - = CspmMonitorAwsOfferingNativeCloudConnection.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorAwsOffering; - }); - } -} 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 deleted file mode 100644 index 7c7a762a0c056..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The native cloud connection configuration. - */ -@Fluent -public final class CspmMonitorAwsOfferingNativeCloudConnection - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of CspmMonitorAwsOfferingNativeCloudConnection class. - */ - public CspmMonitorAwsOfferingNativeCloudConnection() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorAwsOfferingNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorAwsOfferingNativeCloudConnection if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorAwsOfferingNativeCloudConnection. - */ - public static CspmMonitorAwsOfferingNativeCloudConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorAwsOfferingNativeCloudConnection deserializedCspmMonitorAwsOfferingNativeCloudConnection - = new CspmMonitorAwsOfferingNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedCspmMonitorAwsOfferingNativeCloudConnection.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorAwsOfferingNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java deleted file mode 100644 index 8996f071e5a6d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for AzureDevOps offering. - */ -@Immutable -public final class CspmMonitorAzureDevOpsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_AZURE_DEV_OPS; - - /** - * Creates an instance of CspmMonitorAzureDevOpsOffering class. - */ - public CspmMonitorAzureDevOpsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorAzureDevOpsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorAzureDevOpsOffering if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorAzureDevOpsOffering. - */ - public static CspmMonitorAzureDevOpsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorAzureDevOpsOffering deserializedCspmMonitorAzureDevOpsOffering - = new CspmMonitorAzureDevOpsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorAzureDevOpsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorAzureDevOpsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorAzureDevOpsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java deleted file mode 100644 index f70f6296ad9e8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM (Cloud security posture management) monitoring for Docker Hub offering. - */ -@Immutable -public final class CspmMonitorDockerHubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_DOCKER_HUB; - - /** - * Creates an instance of CspmMonitorDockerHubOffering class. - */ - public CspmMonitorDockerHubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorDockerHubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorDockerHubOffering if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorDockerHubOffering. - */ - public static CspmMonitorDockerHubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorDockerHubOffering deserializedCspmMonitorDockerHubOffering = new CspmMonitorDockerHubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorDockerHubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorDockerHubOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorDockerHubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java deleted file mode 100644 index 2ebdeabdb4cce..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for GCP offering. - */ -@Fluent -public final class CspmMonitorGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_GCP; - - /* - * The native cloud connection configuration - */ - private CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection; - - /** - * Creates an instance of CspmMonitorGcpOffering class. - */ - public CspmMonitorGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the CspmMonitorGcpOffering object itself. - */ - public CspmMonitorGcpOffering - withNativeCloudConnection(CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("nativeCloudConnection", this.nativeCloudConnection); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGcpOffering if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorGcpOffering. - */ - public static CspmMonitorGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGcpOffering deserializedCspmMonitorGcpOffering = new CspmMonitorGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorGcpOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("nativeCloudConnection".equals(fieldName)) { - deserializedCspmMonitorGcpOffering.nativeCloudConnection - = CspmMonitorGcpOfferingNativeCloudConnection.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java deleted file mode 100644 index c2516d111cd0e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The native cloud connection configuration. - */ -@Fluent -public final class CspmMonitorGcpOfferingNativeCloudConnection - implements JsonSerializable { - /* - * The GCP workload identity provider id for the offering - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of CspmMonitorGcpOfferingNativeCloudConnection class. - */ - public CspmMonitorGcpOfferingNativeCloudConnection() { - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for the offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for the offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the CspmMonitorGcpOfferingNativeCloudConnection object itself. - */ - public CspmMonitorGcpOfferingNativeCloudConnection - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the CspmMonitorGcpOfferingNativeCloudConnection object itself. - */ - public CspmMonitorGcpOfferingNativeCloudConnection - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGcpOfferingNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGcpOfferingNativeCloudConnection if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorGcpOfferingNativeCloudConnection. - */ - public static CspmMonitorGcpOfferingNativeCloudConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGcpOfferingNativeCloudConnection deserializedCspmMonitorGcpOfferingNativeCloudConnection - = new CspmMonitorGcpOfferingNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedCspmMonitorGcpOfferingNativeCloudConnection.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedCspmMonitorGcpOfferingNativeCloudConnection.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGcpOfferingNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java deleted file mode 100644 index 5288592e193c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM (Cloud security posture management) monitoring for gitlab offering. - */ -@Immutable -public final class CspmMonitorGitLabOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_GIT_LAB; - - /** - * Creates an instance of CspmMonitorGitLabOffering class. - */ - public CspmMonitorGitLabOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGitLabOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGitLabOffering if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorGitLabOffering. - */ - public static CspmMonitorGitLabOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGitLabOffering deserializedCspmMonitorGitLabOffering = new CspmMonitorGitLabOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorGitLabOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorGitLabOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGitLabOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java deleted file mode 100644 index 70b32ff71469b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for github offering. - */ -@Immutable -public final class CspmMonitorGithubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_GITHUB; - - /** - * Creates an instance of CspmMonitorGithubOffering class. - */ - public CspmMonitorGithubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGithubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGithubOffering if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorGithubOffering. - */ - public static CspmMonitorGithubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGithubOffering deserializedCspmMonitorGithubOffering = new CspmMonitorGithubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorGithubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorGithubOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGithubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java deleted file mode 100644 index 212e71dc4d33a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM (Cloud security posture management) monitoring for JFrog Artifactory offering. - */ -@Immutable -public final class CspmMonitorJFrogOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_JFROG; - - /** - * Creates an instance of CspmMonitorJFrogOffering class. - */ - public CspmMonitorJFrogOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorJFrogOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorJFrogOffering if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CspmMonitorJFrogOffering. - */ - public static CspmMonitorJFrogOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorJFrogOffering deserializedCspmMonitorJFrogOffering = new CspmMonitorJFrogOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorJFrogOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorJFrogOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorJFrogOffering; - }); - } -} 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 deleted file mode 100644 index 31e7cbdf895b2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (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 deleted file mode 100644 index 3de840c60d4f5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties; -import java.io.IOException; - -/** - * Custom Assessment Automation request. - */ -@Fluent -public final class CustomAssessmentAutomationRequest extends ProxyResource { - /* - * describes Custom Assessment Automation request properties. - */ - private CustomAssessmentAutomationRequestProperties innerProperties; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CustomAssessmentAutomationRequest class. - */ - public CustomAssessmentAutomationRequest() { - } - - /** - * Get the innerProperties property: describes Custom Assessment Automation request properties. - * - * @return the innerProperties value. - */ - private CustomAssessmentAutomationRequestProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomAssessmentAutomationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomAssessmentAutomationRequest if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CustomAssessmentAutomationRequest. - */ - public static CustomAssessmentAutomationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomAssessmentAutomationRequest deserializedCustomAssessmentAutomationRequest - = new CustomAssessmentAutomationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequest.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequest.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequest.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCustomAssessmentAutomationRequest.innerProperties - = CustomAssessmentAutomationRequestProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomAssessmentAutomationRequest; - }); - } -} 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 deleted file mode 100644 index 664d26aeac330..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (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 custom assessment automation - * - * 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 along with - * {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, - String customAssessmentAutomationName, Context context); - - /** - * Gets a custom assessment automation - * - * 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); - - /** - * Deletes a custom assessment automation - * - * 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 {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String customAssessmentAutomationName, - Context context); - - /** - * Deletes a custom assessment automation - * - * 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); - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom assessment automations in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List custom assessment automations in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a custom assessment automation - * - * 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 along with - * {@link Response}. - */ - CustomAssessmentAutomation getById(String id); - - /** - * Gets a custom assessment automation - * - * 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 along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a custom assessment automation - * - * 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 - * - * 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 {@link 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 deleted file mode 100644 index 215b4ad6a32ce..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of Custom Assessment Automations. - */ -@Fluent -public final class CustomAssessmentAutomationsListResult - implements JsonSerializable { - /* - * Collection of Custom Assessment Automations - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of CustomAssessmentAutomationsListResult class. - */ - public CustomAssessmentAutomationsListResult() { - } - - /** - * 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomAssessmentAutomationsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomAssessmentAutomationsListResult if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomAssessmentAutomationsListResult. - */ - public static CustomAssessmentAutomationsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomAssessmentAutomationsListResult deserializedCustomAssessmentAutomationsListResult - = new CustomAssessmentAutomationsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CustomAssessmentAutomationInner.fromJson(reader1)); - deserializedCustomAssessmentAutomationsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCustomAssessmentAutomationsListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomAssessmentAutomationsListResult; - }); - } -} 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 deleted file mode 100644 index 0ddee9631222c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (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 deleted file mode 100644 index cf4393a9b338d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties; -import java.io.IOException; - -/** - * describes the custom entity store assignment request. - */ -@Fluent -public final class CustomEntityStoreAssignmentRequest implements JsonSerializable { - /* - * describes properties of custom entity store assignment request - */ - private CustomEntityStoreAssignmentRequestProperties innerProperties; - - /** - * Creates an instance of CustomEntityStoreAssignmentRequest class. - */ - public CustomEntityStoreAssignmentRequest() { - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomEntityStoreAssignmentRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomEntityStoreAssignmentRequest if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomEntityStoreAssignmentRequest. - */ - public static CustomEntityStoreAssignmentRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomEntityStoreAssignmentRequest deserializedCustomEntityStoreAssignmentRequest - = new CustomEntityStoreAssignmentRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentRequest.innerProperties - = CustomEntityStoreAssignmentRequestProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomEntityStoreAssignmentRequest; - }); - } -} 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 deleted file mode 100644 index 5293562f0ddad..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (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 custom entity store assignment - * - * 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 along - * with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, - String customEntityStoreAssignmentName, Context context); - - /** - * Gets a custom entity store assignment - * - * 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); - - /** - * Deleted a custom entity store assignment - * - * 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 {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, - Context context); - - /** - * Deleted a custom entity store assignment - * - * 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); - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom entity store assignments in a subscription and a resource group - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List custom entity store assignments in a subscription - * - * 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a custom entity store assignment - * - * 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 along - * with {@link Response}. - */ - CustomEntityStoreAssignment getById(String id); - - /** - * Gets a custom entity store assignment - * - * 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 along - * with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deleted a custom entity store assignment - * - * 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); - - /** - * Deleted a custom entity store assignment - * - * 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 {@link 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 deleted file mode 100644 index f0b33e8a3363a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of custom entity store assignments. - */ -@Fluent -public final class CustomEntityStoreAssignmentsListResult - implements JsonSerializable { - /* - * Collection of custom entity store assignments - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of CustomEntityStoreAssignmentsListResult class. - */ - public CustomEntityStoreAssignmentsListResult() { - } - - /** - * 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomEntityStoreAssignmentsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomEntityStoreAssignmentsListResult if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomEntityStoreAssignmentsListResult. - */ - public static CustomEntityStoreAssignmentsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomEntityStoreAssignmentsListResult deserializedCustomEntityStoreAssignmentsListResult - = new CustomEntityStoreAssignmentsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CustomEntityStoreAssignmentInner.fromJson(reader1)); - deserializedCustomEntityStoreAssignmentsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCustomEntityStoreAssignmentsListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomEntityStoreAssignmentsListResult; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java deleted file mode 100644 index 581f883511786..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * CVE details. - */ -@Immutable -public final class Cve implements JsonSerializable { - /* - * CVE title - */ - private String title; - - /* - * Link url - */ - private String link; - - /** - * Creates an instance of Cve class. - */ - public Cve() { - } - - /** - * Get the title property: CVE title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Get the link property: Link url. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Cve from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Cve if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Cve. - */ - public static Cve fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Cve deserializedCve = new Cve(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("title".equals(fieldName)) { - deserializedCve.title = reader.getString(); - } else if ("link".equals(fieldName)) { - deserializedCve.link = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCve; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java deleted file mode 100644 index 639415df65495..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * CVSS details. - */ -@Immutable -public final class Cvss implements JsonSerializable { - /* - * CVSS base - */ - private Float base; - - /** - * Creates an instance of Cvss class. - */ - public Cvss() { - } - - /** - * Get the base property: CVSS base. - * - * @return the base value. - */ - public Float base() { - return this.base; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Cvss from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Cvss if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Cvss. - */ - public static Cvss fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Cvss deserializedCvss = new Cvss(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("base".equals(fieldName)) { - deserializedCvss.base = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedCvss; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java deleted file mode 100644 index 4c8bffb3401d3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM P1 for AWS offering. - */ -@Fluent -public final class DefenderCspmAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_AWS; - - /* - * The Microsoft Defender for CSPM offering VM scanning configuration - */ - private DefenderCspmAwsOfferingVmScanners vmScanners; - - /* - * The Microsoft Defender Data Sensitivity discovery configuration - */ - private DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery; - - /* - * The databases DSPM configuration - */ - private DefenderCspmAwsOfferingDatabasesDspm databasesDspm; - - /* - * Defenders CSPM Permissions Management offering configurations - */ - private DefenderCspmAwsOfferingCiem ciem; - - /* - * The Microsoft Defender container image assessment configuration - */ - private DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender container agentless discovery K8s configuration - */ - private DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /** - * Creates an instance of DefenderCspmAwsOffering class. - */ - public DefenderCspmAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the vmScanners property: The Microsoft Defender for CSPM offering VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderCspmAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for CSPM offering VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withVmScanners(DefenderCspmAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @return the dataSensitivityDiscovery value. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { - return this.dataSensitivityDiscovery; - } - - /** - * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering - withDataSensitivityDiscovery(DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery) { - this.dataSensitivityDiscovery = dataSensitivityDiscovery; - return this; - } - - /** - * Get the databasesDspm property: The databases DSPM configuration. - * - * @return the databasesDspm value. - */ - public DefenderCspmAwsOfferingDatabasesDspm databasesDspm() { - return this.databasesDspm; - } - - /** - * Set the databasesDspm property: The databases DSPM configuration. - * - * @param databasesDspm the databasesDspm value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withDatabasesDspm(DefenderCspmAwsOfferingDatabasesDspm databasesDspm) { - this.databasesDspm = databasesDspm; - return this; - } - - /** - * Get the ciem property: Defenders CSPM Permissions Management offering configurations. - * - * @return the ciem value. - */ - public DefenderCspmAwsOfferingCiem ciem() { - return this.ciem; - } - - /** - * Set the ciem property: Defenders CSPM Permissions Management offering configurations. - * - * @param ciem the ciem value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withCiem(DefenderCspmAwsOfferingCiem ciem) { - this.ciem = ciem; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withMdcContainersImageAssessment( - DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (vmScanners() != null) { - vmScanners().validate(); - } - if (dataSensitivityDiscovery() != null) { - dataSensitivityDiscovery().validate(); - } - if (databasesDspm() != null) { - databasesDspm().validate(); - } - if (ciem() != null) { - ciem().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - jsonWriter.writeJsonField("dataSensitivityDiscovery", this.dataSensitivityDiscovery); - jsonWriter.writeJsonField("databasesDspm", this.databasesDspm); - jsonWriter.writeJsonField("ciem", this.ciem); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOffering if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOffering. - */ - public static DefenderCspmAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOffering deserializedDefenderCspmAwsOffering = new DefenderCspmAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.vmScanners = DefenderCspmAwsOfferingVmScanners.fromJson(reader); - } else if ("dataSensitivityDiscovery".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.dataSensitivityDiscovery - = DefenderCspmAwsOfferingDataSensitivityDiscovery.fromJson(reader); - } else if ("databasesDspm".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.databasesDspm - = DefenderCspmAwsOfferingDatabasesDspm.fromJson(reader); - } else if ("ciem".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.ciem = DefenderCspmAwsOfferingCiem.fromJson(reader); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.mdcContainersImageAssessment - = DefenderCspmAwsOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java deleted file mode 100644 index cf7e53419e40e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Defenders CSPM Permissions Management offering configurations. - */ -@Fluent -public final class DefenderCspmAwsOfferingCiem implements JsonSerializable { - /* - * Defender CSPM Permissions Management discovery configuration - */ - private DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery; - - /* - * AWS Defender CSPM Permissions Management OIDC (open id connect) connection configurations - */ - private DefenderCspmAwsOfferingCiemOidc ciemOidc; - - /** - * Creates an instance of DefenderCspmAwsOfferingCiem class. - */ - public DefenderCspmAwsOfferingCiem() { - } - - /** - * Get the ciemDiscovery property: Defender CSPM Permissions Management discovery configuration. - * - * @return the ciemDiscovery value. - */ - public DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery() { - return this.ciemDiscovery; - } - - /** - * Set the ciemDiscovery property: Defender CSPM Permissions Management discovery configuration. - * - * @param ciemDiscovery the ciemDiscovery value to set. - * @return the DefenderCspmAwsOfferingCiem object itself. - */ - public DefenderCspmAwsOfferingCiem withCiemDiscovery(DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery) { - this.ciemDiscovery = ciemDiscovery; - return this; - } - - /** - * Get the ciemOidc property: AWS Defender CSPM Permissions Management OIDC (open id connect) connection - * configurations. - * - * @return the ciemOidc value. - */ - public DefenderCspmAwsOfferingCiemOidc ciemOidc() { - return this.ciemOidc; - } - - /** - * Set the ciemOidc property: AWS Defender CSPM Permissions Management OIDC (open id connect) connection - * configurations. - * - * @param ciemOidc the ciemOidc value to set. - * @return the DefenderCspmAwsOfferingCiem object itself. - */ - public DefenderCspmAwsOfferingCiem withCiemOidc(DefenderCspmAwsOfferingCiemOidc ciemOidc) { - this.ciemOidc = ciemOidc; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ciemDiscovery() != null) { - ciemDiscovery().validate(); - } - if (ciemOidc() != null) { - ciemOidc().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("ciemDiscovery", this.ciemDiscovery); - jsonWriter.writeJsonField("ciemOidc", this.ciemOidc); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingCiem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingCiem if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingCiem. - */ - public static DefenderCspmAwsOfferingCiem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingCiem deserializedDefenderCspmAwsOfferingCiem = new DefenderCspmAwsOfferingCiem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("ciemDiscovery".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiem.ciemDiscovery - = DefenderCspmAwsOfferingCiemDiscovery.fromJson(reader); - } else if ("ciemOidc".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiem.ciemOidc = DefenderCspmAwsOfferingCiemOidc.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingCiem; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java deleted file mode 100644 index 893d3d85a2cc6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Defender CSPM Permissions Management discovery configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingCiemDiscovery - implements JsonSerializable { - /* - * The cloud role ARN in AWS for Permissions Management discovery - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingCiemDiscovery class. - */ - public DefenderCspmAwsOfferingCiemDiscovery() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management discovery. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management discovery. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingCiemDiscovery object itself. - */ - public DefenderCspmAwsOfferingCiemDiscovery withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingCiemDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingCiemDiscovery if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingCiemDiscovery. - */ - public static DefenderCspmAwsOfferingCiemDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingCiemDiscovery deserializedDefenderCspmAwsOfferingCiemDiscovery - = new DefenderCspmAwsOfferingCiemDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiemDiscovery.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingCiemDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java deleted file mode 100644 index 512ae40415666..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * AWS Defender CSPM Permissions Management OIDC (open id connect) connection configurations. - */ -@Fluent -public final class DefenderCspmAwsOfferingCiemOidc implements JsonSerializable { - /* - * The cloud role ARN in AWS for Permissions Management used for oidc connection - */ - private String cloudRoleArn; - - /* - * the azure active directory app name used of authenticating against AWS - */ - private String azureActiveDirectoryAppName; - - /** - * Creates an instance of DefenderCspmAwsOfferingCiemOidc class. - */ - public DefenderCspmAwsOfferingCiemOidc() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management used for oidc connection. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management used for oidc connection. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingCiemOidc object itself. - */ - public DefenderCspmAwsOfferingCiemOidc withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Get the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * AWS. - * - * @return the azureActiveDirectoryAppName value. - */ - public String azureActiveDirectoryAppName() { - return this.azureActiveDirectoryAppName; - } - - /** - * Set the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * AWS. - * - * @param azureActiveDirectoryAppName the azureActiveDirectoryAppName value to set. - * @return the DefenderCspmAwsOfferingCiemOidc object itself. - */ - public DefenderCspmAwsOfferingCiemOidc withAzureActiveDirectoryAppName(String azureActiveDirectoryAppName) { - this.azureActiveDirectoryAppName = azureActiveDirectoryAppName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - jsonWriter.writeStringField("azureActiveDirectoryAppName", this.azureActiveDirectoryAppName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingCiemOidc from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingCiemOidc if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingCiemOidc. - */ - public static DefenderCspmAwsOfferingCiemOidc fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingCiemOidc deserializedDefenderCspmAwsOfferingCiemOidc - = new DefenderCspmAwsOfferingCiemOidc(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiemOidc.cloudRoleArn = reader.getString(); - } else if ("azureActiveDirectoryAppName".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiemOidc.azureActiveDirectoryAppName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingCiemOidc; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java deleted file mode 100644 index 8e5516889d63f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Data Sensitivity discovery configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingDataSensitivityDiscovery - implements JsonSerializable { - /* - * Is Microsoft Defender Data Sensitivity discovery enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingDataSensitivityDiscovery class. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery() { - } - - /** - * Get the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingDataSensitivityDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingDataSensitivityDiscovery if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingDataSensitivityDiscovery. - */ - public static DefenderCspmAwsOfferingDataSensitivityDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingDataSensitivityDiscovery deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery - = new DefenderCspmAwsOfferingDataSensitivityDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java deleted file mode 100644 index 1907f6afaae10..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The databases DSPM configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingDatabasesDspm - implements JsonSerializable { - /* - * Is databases DSPM protection enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingDatabasesDspm class. - */ - public DefenderCspmAwsOfferingDatabasesDspm() { - } - - /** - * Get the enabled property: Is databases DSPM protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is databases DSPM protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. - */ - public DefenderCspmAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. - */ - public DefenderCspmAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingDatabasesDspm from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingDatabasesDspm if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingDatabasesDspm. - */ - public static DefenderCspmAwsOfferingDatabasesDspm fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingDatabasesDspm deserializedDefenderCspmAwsOfferingDatabasesDspm - = new DefenderCspmAwsOfferingDatabasesDspm(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDatabasesDspm.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDatabasesDspm.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingDatabasesDspm; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index 54a95b90b3b65..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender container agentless discovery K8s configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery K8s enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S if the JsonReader was pointing - * to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 3c34b05f50752..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender container image assessment configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingMdcContainersImageAssessment class. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingMdcContainersImageAssessment if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingMdcContainersImageAssessment. - */ - public static DefenderCspmAwsOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingMdcContainersImageAssessment deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment - = new DefenderCspmAwsOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java deleted file mode 100644 index 25ff31ea103a5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for CSPM offering VM scanning configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingVmScanners extends VmScannersAws { - /** - * Creates an instance of DefenderCspmAwsOfferingVmScanners class. - */ - public DefenderCspmAwsOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmAwsOfferingVmScanners withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmAwsOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmAwsOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingVmScanners if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmAwsOfferingVmScanners. - */ - public static DefenderCspmAwsOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingVmScanners deserializedDefenderCspmAwsOfferingVmScanners - = new DefenderCspmAwsOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingVmScanners.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java deleted file mode 100644 index e4ee07897e280..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for CSPM Docker Hub offering configurations. - */ -@Immutable -public final class DefenderCspmDockerHubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_DOCKER_HUB; - - /** - * Creates an instance of DefenderCspmDockerHubOffering class. - */ - public DefenderCspmDockerHubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmDockerHubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmDockerHubOffering if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmDockerHubOffering. - */ - public static DefenderCspmDockerHubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmDockerHubOffering deserializedDefenderCspmDockerHubOffering - = new DefenderCspmDockerHubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmDockerHubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmDockerHubOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmDockerHubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java deleted file mode 100644 index 3323a65e9d2a5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM P1 for GCP offering. - */ -@Fluent -public final class DefenderCspmGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_GCP; - - /* - * GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection configurations - */ - private DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery; - - /* - * The Microsoft Defender for CSPM VM scanning configuration - */ - private DefenderCspmGcpOfferingVmScanners vmScanners; - - /* - * The Microsoft Defender Data Sensitivity discovery configuration - */ - private DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery; - - /* - * The Microsoft Defender Container image assessment configuration - */ - private DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender Container agentless discovery configuration - */ - private DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /** - * Creates an instance of DefenderCspmGcpOffering class. - */ - public DefenderCspmGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the ciemDiscovery property: GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection - * configurations. - * - * @return the ciemDiscovery value. - */ - public DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery() { - return this.ciemDiscovery; - } - - /** - * Set the ciemDiscovery property: GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection - * configurations. - * - * @param ciemDiscovery the ciemDiscovery value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withCiemDiscovery(DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery) { - this.ciemDiscovery = ciemDiscovery; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for CSPM VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderCspmGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for CSPM VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withVmScanners(DefenderCspmGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @return the dataSensitivityDiscovery value. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { - return this.dataSensitivityDiscovery; - } - - /** - * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering - withDataSensitivityDiscovery(DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery) { - this.dataSensitivityDiscovery = dataSensitivityDiscovery; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withMdcContainersImageAssessment( - DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (ciemDiscovery() != null) { - ciemDiscovery().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - if (dataSensitivityDiscovery() != null) { - dataSensitivityDiscovery().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("ciemDiscovery", this.ciemDiscovery); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - jsonWriter.writeJsonField("dataSensitivityDiscovery", this.dataSensitivityDiscovery); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOffering if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmGcpOffering. - */ - public static DefenderCspmGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOffering deserializedDefenderCspmGcpOffering = new DefenderCspmGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("ciemDiscovery".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.ciemDiscovery - = DefenderCspmGcpOfferingCiemDiscovery.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.vmScanners = DefenderCspmGcpOfferingVmScanners.fromJson(reader); - } else if ("dataSensitivityDiscovery".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.dataSensitivityDiscovery - = DefenderCspmGcpOfferingDataSensitivityDiscovery.fromJson(reader); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.mdcContainersImageAssessment - = DefenderCspmGcpOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java deleted file mode 100644 index 1d97928b6a8c1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection configurations. - */ -@Fluent -public final class DefenderCspmGcpOfferingCiemDiscovery - implements JsonSerializable { - /* - * The GCP workload identity provider id for Permissions Management offering - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for Permissions Management offering - */ - private String serviceAccountEmailAddress; - - /* - * the azure active directory app name used of authenticating against GCP workload identity federation - */ - private String azureActiveDirectoryAppName; - - /** - * Creates an instance of DefenderCspmGcpOfferingCiemDiscovery class. - */ - public DefenderCspmGcpOfferingCiemDiscovery() { - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for Permissions Management - * offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for Permissions Management - * offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. - */ - public DefenderCspmGcpOfferingCiemDiscovery withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for Permissions Management - * offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for Permissions Management - * offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. - */ - public DefenderCspmGcpOfferingCiemDiscovery withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * GCP workload identity federation. - * - * @return the azureActiveDirectoryAppName value. - */ - public String azureActiveDirectoryAppName() { - return this.azureActiveDirectoryAppName; - } - - /** - * Set the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * GCP workload identity federation. - * - * @param azureActiveDirectoryAppName the azureActiveDirectoryAppName value to set. - * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. - */ - public DefenderCspmGcpOfferingCiemDiscovery withAzureActiveDirectoryAppName(String azureActiveDirectoryAppName) { - this.azureActiveDirectoryAppName = azureActiveDirectoryAppName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("azureActiveDirectoryAppName", this.azureActiveDirectoryAppName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingCiemDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingCiemDiscovery if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmGcpOfferingCiemDiscovery. - */ - public static DefenderCspmGcpOfferingCiemDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingCiemDiscovery deserializedDefenderCspmGcpOfferingCiemDiscovery - = new DefenderCspmGcpOfferingCiemDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingCiemDiscovery.workloadIdentityProviderId = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingCiemDiscovery.serviceAccountEmailAddress = reader.getString(); - } else if ("azureActiveDirectoryAppName".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingCiemDiscovery.azureActiveDirectoryAppName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingCiemDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java deleted file mode 100644 index 6555c0d9cd4c8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Data Sensitivity discovery configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingDataSensitivityDiscovery - implements JsonSerializable { - /* - * Is Microsoft Defender Data Sensitivity discovery enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderCspmGcpOfferingDataSensitivityDiscovery class. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery() { - } - - /** - * Get the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingDataSensitivityDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingDataSensitivityDiscovery if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmGcpOfferingDataSensitivityDiscovery. - */ - public static DefenderCspmGcpOfferingDataSensitivityDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingDataSensitivityDiscovery deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery - = new DefenderCspmGcpOfferingDataSensitivityDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index fe9e84390c434..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Container agentless discovery configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S if the JsonReader was pointing - * to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 358eb39260e56..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Container image assessment configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderCspmGcpOfferingMdcContainersImageAssessment class. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingMdcContainersImageAssessment if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmGcpOfferingMdcContainersImageAssessment. - */ - public static DefenderCspmGcpOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingMdcContainersImageAssessment deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment - = new DefenderCspmGcpOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java deleted file mode 100644 index 4edfbaa4f1d74..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for CSPM VM scanning configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingVmScanners extends VmScannersGcp { - /** - * Creates an instance of DefenderCspmGcpOfferingVmScanners class. - */ - public DefenderCspmGcpOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmGcpOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmGcpOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingVmScanners if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmGcpOfferingVmScanners. - */ - public static DefenderCspmGcpOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingVmScanners deserializedDefenderCspmGcpOfferingVmScanners - = new DefenderCspmGcpOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java deleted file mode 100644 index 2a7cf3f0b5548..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM P1 for JFrog Artifactory offering. - */ -@Fluent -public final class DefenderCspmJFrogOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_JFROG; - - /* - * The Microsoft Defender Container image assessment configuration - */ - private DefenderCspmJFrogOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /** - * Creates an instance of DefenderCspmJFrogOffering class. - */ - public DefenderCspmJFrogOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderCspmJFrogOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderCspmJFrogOffering object itself. - */ - public DefenderCspmJFrogOffering withMdcContainersImageAssessment( - DefenderCspmJFrogOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmJFrogOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmJFrogOffering if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmJFrogOffering. - */ - public static DefenderCspmJFrogOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmJFrogOffering deserializedDefenderCspmJFrogOffering = new DefenderCspmJFrogOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmJFrogOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmJFrogOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderCspmJFrogOffering.mdcContainersImageAssessment - = DefenderCspmJFrogOfferingMdcContainersImageAssessment.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmJFrogOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.java deleted file mode 100644 index fe3bc4d83a11e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Container image assessment configuration. - */ -@Fluent -public final class DefenderCspmJFrogOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /** - * Creates an instance of DefenderCspmJFrogOfferingMdcContainersImageAssessment class. - */ - public DefenderCspmJFrogOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmJFrogOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmJFrogOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmJFrogOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmJFrogOfferingMdcContainersImageAssessment if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderCspmJFrogOfferingMdcContainersImageAssessment. - */ - public static DefenderCspmJFrogOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmJFrogOfferingMdcContainersImageAssessment deserializedDefenderCspmJFrogOfferingMdcContainersImageAssessment - = new DefenderCspmJFrogOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmJFrogOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmJFrogOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java deleted file mode 100644 index 757d83ad985a8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Databases AWS offering. - */ -@Fluent -public final class DefenderFoDatabasesAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_DATABASES_AWS; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The RDS configuration - */ - private DefenderFoDatabasesAwsOfferingRds rds; - - /* - * The databases data security posture management (DSPM) configuration - */ - private DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm; - - /** - * Creates an instance of DefenderFoDatabasesAwsOffering class. - */ - public DefenderFoDatabasesAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering - withArcAutoProvisioning(DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the rds property: The RDS configuration. - * - * @return the rds value. - */ - public DefenderFoDatabasesAwsOfferingRds rds() { - return this.rds; - } - - /** - * Set the rds property: The RDS configuration. - * - * @param rds the rds value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withRds(DefenderFoDatabasesAwsOfferingRds rds) { - this.rds = rds; - return this; - } - - /** - * Get the databasesDspm property: The databases data security posture management (DSPM) configuration. - * - * @return the databasesDspm value. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm() { - return this.databasesDspm; - } - - /** - * Set the databasesDspm property: The databases data security posture management (DSPM) configuration. - * - * @param databasesDspm the databasesDspm value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withDatabasesDspm(DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm) { - this.databasesDspm = databasesDspm; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (rds() != null) { - rds().validate(); - } - if (databasesDspm() != null) { - databasesDspm().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("rds", this.rds); - jsonWriter.writeJsonField("databasesDspm", this.databasesDspm); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOffering if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderFoDatabasesAwsOffering. - */ - public static DefenderFoDatabasesAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOffering deserializedDefenderFoDatabasesAwsOffering - = new DefenderFoDatabasesAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.arcAutoProvisioning - = DefenderFoDatabasesAwsOfferingArcAutoProvisioning.fromJson(reader); - } else if ("rds".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.rds = DefenderFoDatabasesAwsOfferingRds.fromJson(reader); - } else if ("databasesDspm".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.databasesDspm - = DefenderFoDatabasesAwsOfferingDatabasesDspm.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java deleted file mode 100644 index 25438c8ebd0b9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioning extends ArcAutoProvisioningAws { - /** - * Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning class. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderFoDatabasesAwsOfferingArcAutoProvisioning. - */ - public static DefenderFoDatabasesAwsOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOfferingArcAutoProvisioning deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning - = new DefenderFoDatabasesAwsOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java deleted file mode 100644 index 721674780381a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The databases data security posture management (DSPM) configuration. - */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingDatabasesDspm - implements JsonSerializable { - /* - * Is databases data security posture management (DSPM) protection enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderFoDatabasesAwsOfferingDatabasesDspm class. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm() { - } - - /** - * Get the enabled property: Is databases data security posture management (DSPM) protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is databases data security posture management (DSPM) protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingDatabasesDspm object itself. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingDatabasesDspm object itself. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOfferingDatabasesDspm from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOfferingDatabasesDspm if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderFoDatabasesAwsOfferingDatabasesDspm. - */ - public static DefenderFoDatabasesAwsOfferingDatabasesDspm fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOfferingDatabasesDspm deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm - = new DefenderFoDatabasesAwsOfferingDatabasesDspm(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java deleted file mode 100644 index 15acc97c0b773..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The RDS configuration. - */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingRds implements JsonSerializable { - /* - * Is RDS protection enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderFoDatabasesAwsOfferingRds class. - */ - public DefenderFoDatabasesAwsOfferingRds() { - } - - /** - * Get the enabled property: Is RDS protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is RDS protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingRds object itself. - */ - public DefenderFoDatabasesAwsOfferingRds withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingRds object itself. - */ - public DefenderFoDatabasesAwsOfferingRds withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOfferingRds from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOfferingRds if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderFoDatabasesAwsOfferingRds. - */ - public static DefenderFoDatabasesAwsOfferingRds fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOfferingRds deserializedDefenderFoDatabasesAwsOfferingRds - = new DefenderFoDatabasesAwsOfferingRds(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingRds.enabled = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingRds.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOfferingRds; - }); - } -} 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 deleted file mode 100644 index f6da1eed5787d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Containers AWS offering. - */ -@Fluent -public final class DefenderForContainersAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_AWS; - - /* - * The kubernetes service connection configuration - */ - private DefenderForContainersAwsOfferingKubernetesService kubernetesService; - - /* - * The kubernetes data collection connection configuration - */ - private DefenderForContainersAwsOfferingKubernetesDataCollection kubernetesDataCollection; - - /* - * The cloudwatch to kinesis connection configuration - */ - private DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis; - - /* - * The kinesis to s3 connection configuration - */ - private DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3; - - /* - * Is audit logs data collection enabled - */ - private Boolean enableAuditLogsAutoProvisioning; - - /* - * Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled - */ - private Boolean enableDefenderAgentAutoProvisioning; - - /* - * Is Policy Kubernetes agent auto provisioning enabled - */ - private Boolean enablePolicyAgentAutoProvisioning; - - /* - * The retention time in days of kube audit logs set on the CloudWatch log group - */ - private Long kubeAuditRetentionTime; - - /* - * The externalId used by the data reader to prevent the confused deputy attack - */ - private String dataCollectionExternalId; - - /* - * The Microsoft Defender container image assessment configuration - */ - private DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender container agentless discovery K8s configuration - */ - private DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /* - * The Microsoft Defender for Container K8s VM host scanning configuration - */ - private DefenderForContainersAwsOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForContainersAwsOffering class. - */ - public DefenderForContainersAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * 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 kubernetesDataCollection property: The kubernetes data collection connection configuration. - * - * @return the kubernetesDataCollection value. - */ - public DefenderForContainersAwsOfferingKubernetesDataCollection kubernetesDataCollection() { - return this.kubernetesDataCollection; - } - - /** - * Set the kubernetesDataCollection property: The kubernetes data collection connection configuration. - * - * @param kubernetesDataCollection the kubernetesDataCollection value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubernetesDataCollection( - DefenderForContainersAwsOfferingKubernetesDataCollection kubernetesDataCollection) { - this.kubernetesDataCollection = kubernetesDataCollection; - 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; - } - - /** - * Get the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @return the enableAuditLogsAutoProvisioning value. - */ - public Boolean enableAuditLogsAutoProvisioning() { - return this.enableAuditLogsAutoProvisioning; - } - - /** - * Set the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @param enableAuditLogsAutoProvisioning the enableAuditLogsAutoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withEnableAuditLogsAutoProvisioning(Boolean enableAuditLogsAutoProvisioning) { - this.enableAuditLogsAutoProvisioning = enableAuditLogsAutoProvisioning; - return this; - } - - /** - * Get the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @return the enableDefenderAgentAutoProvisioning value. - */ - public Boolean enableDefenderAgentAutoProvisioning() { - return this.enableDefenderAgentAutoProvisioning; - } - - /** - * Set the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @param enableDefenderAgentAutoProvisioning the enableDefenderAgentAutoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withEnableDefenderAgentAutoProvisioning(Boolean enableDefenderAgentAutoProvisioning) { - this.enableDefenderAgentAutoProvisioning = enableDefenderAgentAutoProvisioning; - return this; - } - - /** - * Get the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @return the enablePolicyAgentAutoProvisioning value. - */ - public Boolean enablePolicyAgentAutoProvisioning() { - return this.enablePolicyAgentAutoProvisioning; - } - - /** - * Set the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @param enablePolicyAgentAutoProvisioning the enablePolicyAgentAutoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withEnablePolicyAgentAutoProvisioning(Boolean enablePolicyAgentAutoProvisioning) { - this.enablePolicyAgentAutoProvisioning = enablePolicyAgentAutoProvisioning; - return this; - } - - /** - * Get the kubeAuditRetentionTime property: The retention time in days of kube audit logs set on the CloudWatch log - * group. - * - * @return the kubeAuditRetentionTime value. - */ - public Long kubeAuditRetentionTime() { - return this.kubeAuditRetentionTime; - } - - /** - * Set the kubeAuditRetentionTime property: The retention time in days of kube audit logs set on the CloudWatch log - * group. - * - * @param kubeAuditRetentionTime the kubeAuditRetentionTime value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubeAuditRetentionTime(Long kubeAuditRetentionTime) { - this.kubeAuditRetentionTime = kubeAuditRetentionTime; - return this; - } - - /** - * Get the dataCollectionExternalId property: The externalId used by the data reader to prevent the confused deputy - * attack. - * - * @return the dataCollectionExternalId value. - */ - public String dataCollectionExternalId() { - return this.dataCollectionExternalId; - } - - /** - * Set the dataCollectionExternalId property: The externalId used by the data reader to prevent the confused deputy - * attack. - * - * @param dataCollectionExternalId the dataCollectionExternalId value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withDataCollectionExternalId(String dataCollectionExternalId) { - this.dataCollectionExternalId = dataCollectionExternalId; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withMdcContainersImageAssessment( - DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForContainersAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withVmScanners(DefenderForContainersAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (kubernetesService() != null) { - kubernetesService().validate(); - } - if (kubernetesDataCollection() != null) { - kubernetesDataCollection().validate(); - } - if (cloudWatchToKinesis() != null) { - cloudWatchToKinesis().validate(); - } - if (kinesisToS3() != null) { - kinesisToS3().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("kubernetesService", this.kubernetesService); - jsonWriter.writeJsonField("kubernetesDataCollection", this.kubernetesDataCollection); - jsonWriter.writeJsonField("cloudWatchToKinesis", this.cloudWatchToKinesis); - jsonWriter.writeJsonField("kinesisToS3", this.kinesisToS3); - jsonWriter.writeBooleanField("enableAuditLogsAutoProvisioning", this.enableAuditLogsAutoProvisioning); - jsonWriter.writeBooleanField("enableDefenderAgentAutoProvisioning", this.enableDefenderAgentAutoProvisioning); - jsonWriter.writeBooleanField("enablePolicyAgentAutoProvisioning", this.enablePolicyAgentAutoProvisioning); - jsonWriter.writeNumberField("kubeAuditRetentionTime", this.kubeAuditRetentionTime); - jsonWriter.writeStringField("dataCollectionExternalId", this.dataCollectionExternalId); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOffering if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersAwsOffering. - */ - public static DefenderForContainersAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOffering deserializedDefenderForContainersAwsOffering - = new DefenderForContainersAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("kubernetesService".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kubernetesService - = DefenderForContainersAwsOfferingKubernetesService.fromJson(reader); - } else if ("kubernetesDataCollection".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kubernetesDataCollection - = DefenderForContainersAwsOfferingKubernetesDataCollection.fromJson(reader); - } else if ("cloudWatchToKinesis".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.cloudWatchToKinesis - = DefenderForContainersAwsOfferingCloudWatchToKinesis.fromJson(reader); - } else if ("kinesisToS3".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kinesisToS3 - = DefenderForContainersAwsOfferingKinesisToS3.fromJson(reader); - } else if ("enableAuditLogsAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.enableAuditLogsAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enableDefenderAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.enableDefenderAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enablePolicyAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.enablePolicyAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("kubeAuditRetentionTime".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kubeAuditRetentionTime - = reader.getNullable(JsonReader::getLong); - } else if ("dataCollectionExternalId".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.dataCollectionExternalId = reader.getString(); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.mdcContainersImageAssessment - = DefenderForContainersAwsOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.vmScanners - = DefenderForContainersAwsOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOffering; - }); - } -} 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 deleted file mode 100644 index 79bc50324bd9b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The cloudwatch to kinesis connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingCloudWatchToKinesis - implements JsonSerializable { - /* - * The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingCloudWatchToKinesis class. - */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - * - * @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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingCloudWatchToKinesis from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingCloudWatchToKinesis if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersAwsOfferingCloudWatchToKinesis. - */ - public static DefenderForContainersAwsOfferingCloudWatchToKinesis fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingCloudWatchToKinesis deserializedDefenderForContainersAwsOfferingCloudWatchToKinesis - = new DefenderForContainersAwsOfferingCloudWatchToKinesis(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingCloudWatchToKinesis.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingCloudWatchToKinesis; - }); - } -} 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 deleted file mode 100644 index 2922e5aa3dc1e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The kinesis to s3 connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingKinesisToS3 - implements JsonSerializable { - /* - * The cloud role ARN in AWS used by Kinesis to transfer data into S3 - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingKinesisToS3 class. - */ - public DefenderForContainersAwsOfferingKinesisToS3() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS used by Kinesis to transfer data into S3. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS used by Kinesis to transfer data into S3. - * - * @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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingKinesisToS3 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingKinesisToS3 if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersAwsOfferingKinesisToS3. - */ - public static DefenderForContainersAwsOfferingKinesisToS3 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingKinesisToS3 deserializedDefenderForContainersAwsOfferingKinesisToS3 - = new DefenderForContainersAwsOfferingKinesisToS3(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingKinesisToS3.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingKinesisToS3; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.java deleted file mode 100644 index 29c675ab9cbed..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The kubernetes data collection connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingKubernetesDataCollection - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature used for reading data - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingKubernetesDataCollection class. - */ - public DefenderForContainersAwsOfferingKubernetesDataCollection() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKubernetesDataCollection object itself. - */ - public DefenderForContainersAwsOfferingKubernetesDataCollection withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingKubernetesDataCollection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingKubernetesDataCollection if the JsonReader was pointing to - * an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForContainersAwsOfferingKubernetesDataCollection. - */ - public static DefenderForContainersAwsOfferingKubernetesDataCollection fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingKubernetesDataCollection deserializedDefenderForContainersAwsOfferingKubernetesDataCollection - = new DefenderForContainersAwsOfferingKubernetesDataCollection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingKubernetesDataCollection.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingKubernetesDataCollection; - }); - } -} 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 deleted file mode 100644 index 75c5df18ba6d0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The kubernetes service connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingKubernetesService - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature used for provisioning resources - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingKubernetesService class. - */ - public DefenderForContainersAwsOfferingKubernetesService() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for provisioning resources. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature used for provisioning resources. - * - * @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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingKubernetesService from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingKubernetesService if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersAwsOfferingKubernetesService. - */ - public static DefenderForContainersAwsOfferingKubernetesService fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingKubernetesService deserializedDefenderForContainersAwsOfferingKubernetesService - = new DefenderForContainersAwsOfferingKubernetesService(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingKubernetesService.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingKubernetesService; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index b7b825de699fe..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender container agentless discovery K8s configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery K8s enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 09a69addc3fe9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender container image assessment configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment class. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForContainersAwsOfferingMdcContainersImageAssessment. - */ - public static DefenderForContainersAwsOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingMdcContainersImageAssessment deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment - = new DefenderForContainersAwsOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java deleted file mode 100644 index bf1e036f28cb6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Container K8s VM host scanning configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingVmScanners extends VmScannersAws { - /** - * Creates an instance of DefenderForContainersAwsOfferingVmScanners class. - */ - public DefenderForContainersAwsOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersAwsOfferingVmScanners withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersAwsOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersAwsOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingVmScanners if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersAwsOfferingVmScanners. - */ - public static DefenderForContainersAwsOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingVmScanners deserializedDefenderForContainersAwsOfferingVmScanners - = new DefenderForContainersAwsOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingVmScanners.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java deleted file mode 100644 index 2d9d2d1111631..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for containers Docker Hub offering configurations. - */ -@Immutable -public final class DefenderForContainersDockerHubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_DOCKER_HUB; - - /** - * Creates an instance of DefenderForContainersDockerHubOffering class. - */ - public DefenderForContainersDockerHubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersDockerHubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersDockerHubOffering if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersDockerHubOffering. - */ - public static DefenderForContainersDockerHubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersDockerHubOffering deserializedDefenderForContainersDockerHubOffering - = new DefenderForContainersDockerHubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersDockerHubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersDockerHubOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersDockerHubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java deleted file mode 100644 index c055f7a2433fe..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The containers GCP offering. - */ -@Fluent -public final class DefenderForContainersGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_GCP; - - /* - * The native cloud connection configuration - */ - private DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection; - - /* - * The native cloud connection configuration - */ - private DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection; - - /* - * Is audit logs data collection enabled - */ - private Boolean enableAuditLogsAutoProvisioning; - - /* - * Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled - */ - private Boolean enableDefenderAgentAutoProvisioning; - - /* - * Is Policy Kubernetes agent auto provisioning enabled - */ - private Boolean enablePolicyAgentAutoProvisioning; - - /* - * The Microsoft Defender Container image assessment configuration - */ - private DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender Container agentless discovery configuration - */ - private DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /* - * The Microsoft Defender for Container K8s VM host scanning configuration - */ - private DefenderForContainersGcpOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForContainersGcpOffering class. - */ - public DefenderForContainersGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withNativeCloudConnection(DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Get the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * - * @return the dataPipelineNativeCloudConnection value. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection() { - return this.dataPipelineNativeCloudConnection; - } - - /** - * Set the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * - * @param dataPipelineNativeCloudConnection the dataPipelineNativeCloudConnection value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withDataPipelineNativeCloudConnection( - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection) { - this.dataPipelineNativeCloudConnection = dataPipelineNativeCloudConnection; - return this; - } - - /** - * Get the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @return the enableAuditLogsAutoProvisioning value. - */ - public Boolean enableAuditLogsAutoProvisioning() { - return this.enableAuditLogsAutoProvisioning; - } - - /** - * Set the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @param enableAuditLogsAutoProvisioning the enableAuditLogsAutoProvisioning value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withEnableAuditLogsAutoProvisioning(Boolean enableAuditLogsAutoProvisioning) { - this.enableAuditLogsAutoProvisioning = enableAuditLogsAutoProvisioning; - return this; - } - - /** - * Get the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @return the enableDefenderAgentAutoProvisioning value. - */ - public Boolean enableDefenderAgentAutoProvisioning() { - return this.enableDefenderAgentAutoProvisioning; - } - - /** - * Set the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @param enableDefenderAgentAutoProvisioning the enableDefenderAgentAutoProvisioning value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withEnableDefenderAgentAutoProvisioning(Boolean enableDefenderAgentAutoProvisioning) { - this.enableDefenderAgentAutoProvisioning = enableDefenderAgentAutoProvisioning; - return this; - } - - /** - * Get the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @return the enablePolicyAgentAutoProvisioning value. - */ - public Boolean enablePolicyAgentAutoProvisioning() { - return this.enablePolicyAgentAutoProvisioning; - } - - /** - * Set the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @param enablePolicyAgentAutoProvisioning the enablePolicyAgentAutoProvisioning value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withEnablePolicyAgentAutoProvisioning(Boolean enablePolicyAgentAutoProvisioning) { - this.enablePolicyAgentAutoProvisioning = enablePolicyAgentAutoProvisioning; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withMdcContainersImageAssessment( - DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForContainersGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withVmScanners(DefenderForContainersGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - if (dataPipelineNativeCloudConnection() != null) { - dataPipelineNativeCloudConnection().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("nativeCloudConnection", this.nativeCloudConnection); - jsonWriter.writeJsonField("dataPipelineNativeCloudConnection", this.dataPipelineNativeCloudConnection); - jsonWriter.writeBooleanField("enableAuditLogsAutoProvisioning", this.enableAuditLogsAutoProvisioning); - jsonWriter.writeBooleanField("enableDefenderAgentAutoProvisioning", this.enableDefenderAgentAutoProvisioning); - jsonWriter.writeBooleanField("enablePolicyAgentAutoProvisioning", this.enablePolicyAgentAutoProvisioning); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOffering if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersGcpOffering. - */ - public static DefenderForContainersGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOffering deserializedDefenderForContainersGcpOffering - = new DefenderForContainersGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("nativeCloudConnection".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.nativeCloudConnection - = DefenderForContainersGcpOfferingNativeCloudConnection.fromJson(reader); - } else if ("dataPipelineNativeCloudConnection".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.dataPipelineNativeCloudConnection - = DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.fromJson(reader); - } else if ("enableAuditLogsAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.enableAuditLogsAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enableDefenderAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.enableDefenderAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enablePolicyAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.enablePolicyAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.mdcContainersImageAssessment - = DefenderForContainersGcpOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.vmScanners - = DefenderForContainersGcpOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java deleted file mode 100644 index 7b2a4f4a4afb9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The native cloud connection configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - implements JsonSerializable { - /* - * The data collection service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /* - * The data collection GCP workload identity provider id for this offering - */ - private String workloadIdentityProviderId; - - /** - * Creates an instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection class. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() { - } - - /** - * Get the serviceAccountEmailAddress property: The data collection service account email address in GCP for this - * offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The data collection service account email address in GCP for this - * offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this - * offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this - * offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. - */ - public static DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - = new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.serviceAccountEmailAddress - = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.workloadIdentityProviderId - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index 50966e3b00bf5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Container agentless discovery configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java deleted file mode 100644 index d457f2fe0f00b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender Container image assessment configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment class. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForContainersGcpOfferingMdcContainersImageAssessment. - */ - public static DefenderForContainersGcpOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingMdcContainersImageAssessment deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment - = new DefenderForContainersGcpOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java deleted file mode 100644 index a62ba7a0a6a8f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The native cloud connection configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingNativeCloudConnection - implements JsonSerializable { - /* - * The service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id for this offering - */ - private String workloadIdentityProviderId; - - /** - * Creates an instance of DefenderForContainersGcpOfferingNativeCloudConnection class. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection() { - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingNativeCloudConnection if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersGcpOfferingNativeCloudConnection. - */ - public static DefenderForContainersGcpOfferingNativeCloudConnection fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingNativeCloudConnection deserializedDefenderForContainersGcpOfferingNativeCloudConnection - = new DefenderForContainersGcpOfferingNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingNativeCloudConnection.serviceAccountEmailAddress - = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingNativeCloudConnection.workloadIdentityProviderId - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java deleted file mode 100644 index 6df48311dfebb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Container K8s VM host scanning configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingVmScanners extends VmScannersGcp { - /** - * Creates an instance of DefenderForContainersGcpOfferingVmScanners class. - */ - public DefenderForContainersGcpOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersGcpOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersGcpOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingVmScanners if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersGcpOfferingVmScanners. - */ - public static DefenderForContainersGcpOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingVmScanners deserializedDefenderForContainersGcpOfferingVmScanners - = new DefenderForContainersGcpOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java deleted file mode 100644 index d3b69dfcbbac4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Containers for JFrog Artifactory offering. - */ -@Immutable -public final class DefenderForContainersJFrogOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_JFROG; - - /** - * Creates an instance of DefenderForContainersJFrogOffering class. - */ - public DefenderForContainersJFrogOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersJFrogOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersJFrogOffering if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForContainersJFrogOffering. - */ - public static DefenderForContainersJFrogOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersJFrogOffering deserializedDefenderForContainersJFrogOffering - = new DefenderForContainersJFrogOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersJFrogOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersJFrogOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersJFrogOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java deleted file mode 100644 index 5b66391450069..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Databases GCP offering configurations. - */ -@Fluent -public final class DefenderForDatabasesGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_DATABASES_GCP; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The native cloud connection configuration - */ - private DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning; - - /** - * Creates an instance of DefenderForDatabasesGcpOffering class. - */ - public DefenderForDatabasesGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForDatabasesGcpOffering object itself. - */ - public DefenderForDatabasesGcpOffering - withArcAutoProvisioning(DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the defenderForDatabasesArcAutoProvisioning property: The native cloud connection configuration. - * - * @return the defenderForDatabasesArcAutoProvisioning value. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - defenderForDatabasesArcAutoProvisioning() { - return this.defenderForDatabasesArcAutoProvisioning; - } - - /** - * Set the defenderForDatabasesArcAutoProvisioning property: The native cloud connection configuration. - * - * @param defenderForDatabasesArcAutoProvisioning the defenderForDatabasesArcAutoProvisioning value to set. - * @return the DefenderForDatabasesGcpOffering object itself. - */ - public DefenderForDatabasesGcpOffering withDefenderForDatabasesArcAutoProvisioning( - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning) { - this.defenderForDatabasesArcAutoProvisioning = defenderForDatabasesArcAutoProvisioning; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (defenderForDatabasesArcAutoProvisioning() != null) { - defenderForDatabasesArcAutoProvisioning().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("defenderForDatabasesArcAutoProvisioning", - this.defenderForDatabasesArcAutoProvisioning); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForDatabasesGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForDatabasesGcpOffering if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForDatabasesGcpOffering. - */ - public static DefenderForDatabasesGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForDatabasesGcpOffering deserializedDefenderForDatabasesGcpOffering - = new DefenderForDatabasesGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.arcAutoProvisioning - = DefenderForDatabasesGcpOfferingArcAutoProvisioning.fromJson(reader); - } else if ("defenderForDatabasesArcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.defenderForDatabasesArcAutoProvisioning - = DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForDatabasesGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java deleted file mode 100644 index 69aa0273fd57a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioning extends ArcAutoProvisioningGcp { - /** - * Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning class. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForDatabasesGcpOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForDatabasesGcpOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForDatabasesGcpOfferingArcAutoProvisioning. - */ - public static DefenderForDatabasesGcpOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForDatabasesGcpOfferingArcAutoProvisioning deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning - = new DefenderForDatabasesGcpOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java deleted file mode 100644 index bb52cddda555f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The native cloud connection configuration. - */ -@Fluent -public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - implements JsonSerializable { - /* - * The service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id for this offering - */ - private String workloadIdentityProviderId; - - /** - * Creates an instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning class. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() { - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning if the JsonReader - * was pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. - */ - public static DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - = new DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.serviceAccountEmailAddress - = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.workloadIdentityProviderId - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning; - }); - } -} 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 deleted file mode 100644 index 6cf8056eace73..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Servers AWS offering. - */ -@Fluent -public final class DefenderForServersAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_SERVERS_AWS; - - /* - * The Defender for servers connection configuration - */ - private DefenderForServersAwsOfferingDefenderForServers defenderForServers; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The Vulnerability Assessment autoprovisioning configuration - */ - private DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning; - - /* - * The Microsoft Defender for Endpoint autoprovisioning configuration - */ - private DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning; - - /* - * configuration for the servers offering subPlan - */ - private DefenderForServersAwsOfferingSubPlan subPlan; - - /* - * The Microsoft Defender for Server VM scanning configuration - */ - private DefenderForServersAwsOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForServersAwsOffering class. - */ - public DefenderForServersAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * 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; - } - - /** - * Get the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @return the vaAutoProvisioning value. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning() { - return this.vaAutoProvisioning; - } - - /** - * Set the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @param vaAutoProvisioning the vaAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering - withVaAutoProvisioning(DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning) { - this.vaAutoProvisioning = vaAutoProvisioning; - return this; - } - - /** - * Get the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @return the mdeAutoProvisioning value. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning() { - return this.mdeAutoProvisioning; - } - - /** - * Set the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @param mdeAutoProvisioning the mdeAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering - withMdeAutoProvisioning(DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning) { - this.mdeAutoProvisioning = mdeAutoProvisioning; - return this; - } - - /** - * Get the subPlan property: configuration for the servers offering subPlan. - * - * @return the subPlan value. - */ - public DefenderForServersAwsOfferingSubPlan subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: configuration for the servers offering subPlan. - * - * @param subPlan the subPlan value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withSubPlan(DefenderForServersAwsOfferingSubPlan subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForServersAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withVmScanners(DefenderForServersAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (defenderForServers() != null) { - defenderForServers().validate(); - } - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (vaAutoProvisioning() != null) { - vaAutoProvisioning().validate(); - } - if (mdeAutoProvisioning() != null) { - mdeAutoProvisioning().validate(); - } - if (subPlan() != null) { - subPlan().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("defenderForServers", this.defenderForServers); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("vaAutoProvisioning", this.vaAutoProvisioning); - jsonWriter.writeJsonField("mdeAutoProvisioning", this.mdeAutoProvisioning); - jsonWriter.writeJsonField("subPlan", this.subPlan); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOffering if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOffering. - */ - public static DefenderForServersAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOffering deserializedDefenderForServersAwsOffering - = new DefenderForServersAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("defenderForServers".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.defenderForServers - = DefenderForServersAwsOfferingDefenderForServers.fromJson(reader); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.arcAutoProvisioning - = DefenderForServersAwsOfferingArcAutoProvisioning.fromJson(reader); - } else if ("vaAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.vaAutoProvisioning - = DefenderForServersAwsOfferingVaAutoProvisioning.fromJson(reader); - } else if ("mdeAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.mdeAutoProvisioning - = DefenderForServersAwsOfferingMdeAutoProvisioning.fromJson(reader); - } else if ("subPlan".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.subPlan - = DefenderForServersAwsOfferingSubPlan.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.vmScanners - = DefenderForServersAwsOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOffering; - }); - } -} 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 deleted file mode 100644 index 2fb358cfce394..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingArcAutoProvisioning extends ArcAutoProvisioningAws { - /** - * Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioning class. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingArcAutoProvisioning withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingArcAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOfferingArcAutoProvisioning. - */ - public static DefenderForServersAwsOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingArcAutoProvisioning deserializedDefenderForServersAwsOfferingArcAutoProvisioning - = new DefenderForServersAwsOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingArcAutoProvisioning.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingArcAutoProvisioning; - }); - } -} 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 deleted file mode 100644 index eee7509cdef63..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for servers connection configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingDefenderForServers - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForServersAwsOfferingDefenderForServers class. - */ - public DefenderForServersAwsOfferingDefenderForServers() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingDefenderForServers from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingDefenderForServers if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOfferingDefenderForServers. - */ - public static DefenderForServersAwsOfferingDefenderForServers fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingDefenderForServers deserializedDefenderForServersAwsOfferingDefenderForServers - = new DefenderForServersAwsOfferingDefenderForServers(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingDefenderForServers.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingDefenderForServers; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java deleted file mode 100644 index 3c160dc0a66dd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Endpoint autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingMdeAutoProvisioning - implements JsonSerializable { - /* - * Is Microsoft Defender for Endpoint auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Endpoint autoprovisioning - */ - private Object configuration; - - /** - * Creates an instance of DefenderForServersAwsOfferingMdeAutoProvisioning class. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @return the configuration value. - */ - public Object configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning withConfiguration(Object configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeUntypedField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingMdeAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingMdeAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOfferingMdeAutoProvisioning. - */ - public static DefenderForServersAwsOfferingMdeAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingMdeAutoProvisioning deserializedDefenderForServersAwsOfferingMdeAutoProvisioning - = new DefenderForServersAwsOfferingMdeAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingMdeAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingMdeAutoProvisioning.configuration = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingMdeAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java deleted file mode 100644 index 1f8749805e477..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * configuration for the servers offering subPlan. - */ -@Fluent -public final class DefenderForServersAwsOfferingSubPlan - implements JsonSerializable { - /* - * The available sub plans - */ - private SubPlan type; - - /** - * Creates an instance of DefenderForServersAwsOfferingSubPlan class. - */ - public DefenderForServersAwsOfferingSubPlan() { - } - - /** - * Get the type property: The available sub plans. - * - * @return the type value. - */ - public SubPlan type() { - return this.type; - } - - /** - * Set the type property: The available sub plans. - * - * @param type the type value to set. - * @return the DefenderForServersAwsOfferingSubPlan object itself. - */ - public DefenderForServersAwsOfferingSubPlan withType(SubPlan type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingSubPlan from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingSubPlan if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOfferingSubPlan. - */ - public static DefenderForServersAwsOfferingSubPlan fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingSubPlan deserializedDefenderForServersAwsOfferingSubPlan - = new DefenderForServersAwsOfferingSubPlan(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingSubPlan.type = SubPlan.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingSubPlan; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java deleted file mode 100644 index 2d542688b8b3c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Vulnerability Assessment autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingVaAutoProvisioning - implements JsonSerializable { - /* - * Is Vulnerability Assessment auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Vulnerability Assessment autoprovisioning - */ - private DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration; - - /** - * Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioning class. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning() { - } - - /** - * Get the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @return the configuration value. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning - withConfiguration(DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeJsonField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingVaAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingVaAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOfferingVaAutoProvisioning. - */ - public static DefenderForServersAwsOfferingVaAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingVaAutoProvisioning deserializedDefenderForServersAwsOfferingVaAutoProvisioning - = new DefenderForServersAwsOfferingVaAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVaAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVaAutoProvisioning.configuration - = DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingVaAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java deleted file mode 100644 index 784802c2ea548..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * configuration for Vulnerability Assessment autoprovisioning. - */ -@Fluent -public final class DefenderForServersAwsOfferingVaAutoProvisioningConfiguration - implements JsonSerializable { - /* - * The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' - */ - private Type type; - - /** - * Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration class. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration() { - } - - /** - * Get the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @return the type value. - */ - public Type type() { - return this.type; - } - - /** - * Set the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @param type the type value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioningConfiguration object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration withType(Type type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. - */ - public static DefenderForServersAwsOfferingVaAutoProvisioningConfiguration fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration deserializedDefenderForServersAwsOfferingVaAutoProvisioningConfiguration - = new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVaAutoProvisioningConfiguration.type - = Type.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingVaAutoProvisioningConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java deleted file mode 100644 index 789c49fc3ad98..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Server VM scanning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingVmScanners extends VmScannersAws { - /** - * Creates an instance of DefenderForServersAwsOfferingVmScanners class. - */ - public DefenderForServersAwsOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingVmScanners withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingVmScanners if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersAwsOfferingVmScanners. - */ - public static DefenderForServersAwsOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingVmScanners deserializedDefenderForServersAwsOfferingVmScanners - = new DefenderForServersAwsOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVmScanners.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java deleted file mode 100644 index 435a62e581e04..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Servers GCP offering configurations. - */ -@Fluent -public final class DefenderForServersGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_SERVERS_GCP; - - /* - * The Defender for servers connection configuration - */ - private DefenderForServersGcpOfferingDefenderForServers defenderForServers; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The Vulnerability Assessment autoprovisioning configuration - */ - private DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning; - - /* - * The Microsoft Defender for Endpoint autoprovisioning configuration - */ - private DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning; - - /* - * configuration for the servers offering subPlan - */ - private DefenderForServersGcpOfferingSubPlan subPlan; - - /* - * The Microsoft Defender for Server VM scanning configuration - */ - private DefenderForServersGcpOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForServersGcpOffering class. - */ - public DefenderForServersGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the defenderForServers property: The Defender for servers connection configuration. - * - * @return the defenderForServers value. - */ - public DefenderForServersGcpOfferingDefenderForServers defenderForServers() { - return this.defenderForServers; - } - - /** - * Set the defenderForServers property: The Defender for servers connection configuration. - * - * @param defenderForServers the defenderForServers value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withDefenderForServers(DefenderForServersGcpOfferingDefenderForServers defenderForServers) { - this.defenderForServers = defenderForServers; - return this; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withArcAutoProvisioning(DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @return the vaAutoProvisioning value. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning() { - return this.vaAutoProvisioning; - } - - /** - * Set the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @param vaAutoProvisioning the vaAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withVaAutoProvisioning(DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning) { - this.vaAutoProvisioning = vaAutoProvisioning; - return this; - } - - /** - * Get the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @return the mdeAutoProvisioning value. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning() { - return this.mdeAutoProvisioning; - } - - /** - * Set the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @param mdeAutoProvisioning the mdeAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withMdeAutoProvisioning(DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning) { - this.mdeAutoProvisioning = mdeAutoProvisioning; - return this; - } - - /** - * Get the subPlan property: configuration for the servers offering subPlan. - * - * @return the subPlan value. - */ - public DefenderForServersGcpOfferingSubPlan subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: configuration for the servers offering subPlan. - * - * @param subPlan the subPlan value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withSubPlan(DefenderForServersGcpOfferingSubPlan subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForServersGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withVmScanners(DefenderForServersGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (defenderForServers() != null) { - defenderForServers().validate(); - } - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (vaAutoProvisioning() != null) { - vaAutoProvisioning().validate(); - } - if (mdeAutoProvisioning() != null) { - mdeAutoProvisioning().validate(); - } - if (subPlan() != null) { - subPlan().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("defenderForServers", this.defenderForServers); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("vaAutoProvisioning", this.vaAutoProvisioning); - jsonWriter.writeJsonField("mdeAutoProvisioning", this.mdeAutoProvisioning); - jsonWriter.writeJsonField("subPlan", this.subPlan); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOffering if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOffering. - */ - public static DefenderForServersGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOffering deserializedDefenderForServersGcpOffering - = new DefenderForServersGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("defenderForServers".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.defenderForServers - = DefenderForServersGcpOfferingDefenderForServers.fromJson(reader); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.arcAutoProvisioning - = DefenderForServersGcpOfferingArcAutoProvisioning.fromJson(reader); - } else if ("vaAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.vaAutoProvisioning - = DefenderForServersGcpOfferingVaAutoProvisioning.fromJson(reader); - } else if ("mdeAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.mdeAutoProvisioning - = DefenderForServersGcpOfferingMdeAutoProvisioning.fromJson(reader); - } else if ("subPlan".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.subPlan - = DefenderForServersGcpOfferingSubPlan.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.vmScanners - = DefenderForServersGcpOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java deleted file mode 100644 index dd99e18208af8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingArcAutoProvisioning extends ArcAutoProvisioningGcp { - /** - * Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioning class. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingArcAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOfferingArcAutoProvisioning. - */ - public static DefenderForServersGcpOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingArcAutoProvisioning deserializedDefenderForServersGcpOfferingArcAutoProvisioning - = new DefenderForServersGcpOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java deleted file mode 100644 index b6f2c6288be53..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for servers connection configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingDefenderForServers - implements JsonSerializable { - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderForServersGcpOfferingDefenderForServers class. - */ - public DefenderForServersGcpOfferingDefenderForServers() { - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForServersGcpOfferingDefenderForServers object itself. - */ - public DefenderForServersGcpOfferingDefenderForServers - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForServersGcpOfferingDefenderForServers object itself. - */ - public DefenderForServersGcpOfferingDefenderForServers - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingDefenderForServers from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingDefenderForServers if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOfferingDefenderForServers. - */ - public static DefenderForServersGcpOfferingDefenderForServers fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingDefenderForServers deserializedDefenderForServersGcpOfferingDefenderForServers - = new DefenderForServersGcpOfferingDefenderForServers(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingDefenderForServers.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingDefenderForServers.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingDefenderForServers; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java deleted file mode 100644 index f937c12462190..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Endpoint autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingMdeAutoProvisioning - implements JsonSerializable { - /* - * Is Microsoft Defender for Endpoint auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Endpoint autoprovisioning - */ - private Object configuration; - - /** - * Creates an instance of DefenderForServersGcpOfferingMdeAutoProvisioning class. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @return the configuration value. - */ - public Object configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning withConfiguration(Object configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeUntypedField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingMdeAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingMdeAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOfferingMdeAutoProvisioning. - */ - public static DefenderForServersGcpOfferingMdeAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingMdeAutoProvisioning deserializedDefenderForServersGcpOfferingMdeAutoProvisioning - = new DefenderForServersGcpOfferingMdeAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingMdeAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingMdeAutoProvisioning.configuration = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingMdeAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java deleted file mode 100644 index c9f7fc4d672ae..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * configuration for the servers offering subPlan. - */ -@Fluent -public final class DefenderForServersGcpOfferingSubPlan - implements JsonSerializable { - /* - * The available sub plans - */ - private SubPlan type; - - /** - * Creates an instance of DefenderForServersGcpOfferingSubPlan class. - */ - public DefenderForServersGcpOfferingSubPlan() { - } - - /** - * Get the type property: The available sub plans. - * - * @return the type value. - */ - public SubPlan type() { - return this.type; - } - - /** - * Set the type property: The available sub plans. - * - * @param type the type value to set. - * @return the DefenderForServersGcpOfferingSubPlan object itself. - */ - public DefenderForServersGcpOfferingSubPlan withType(SubPlan type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingSubPlan from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingSubPlan if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOfferingSubPlan. - */ - public static DefenderForServersGcpOfferingSubPlan fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingSubPlan deserializedDefenderForServersGcpOfferingSubPlan - = new DefenderForServersGcpOfferingSubPlan(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingSubPlan.type = SubPlan.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingSubPlan; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java deleted file mode 100644 index 5c235a8f90dfc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Vulnerability Assessment autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingVaAutoProvisioning - implements JsonSerializable { - /* - * Is Vulnerability Assessment auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Vulnerability Assessment autoprovisioning - */ - private DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration; - - /** - * Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioning class. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning() { - } - - /** - * Get the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @return the configuration value. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning - withConfiguration(DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeJsonField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingVaAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingVaAutoProvisioning if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOfferingVaAutoProvisioning. - */ - public static DefenderForServersGcpOfferingVaAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingVaAutoProvisioning deserializedDefenderForServersGcpOfferingVaAutoProvisioning - = new DefenderForServersGcpOfferingVaAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVaAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVaAutoProvisioning.configuration - = DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingVaAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java deleted file mode 100644 index 9622ce1c3ab2c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * configuration for Vulnerability Assessment autoprovisioning. - */ -@Fluent -public final class DefenderForServersGcpOfferingVaAutoProvisioningConfiguration - implements JsonSerializable { - /* - * The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' - */ - private Type type; - - /** - * Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration class. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration() { - } - - /** - * Get the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @return the type value. - */ - public Type type() { - return this.type; - } - - /** - * Set the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @param type the type value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioningConfiguration object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration withType(Type type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the - * DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. - */ - public static DefenderForServersGcpOfferingVaAutoProvisioningConfiguration fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration deserializedDefenderForServersGcpOfferingVaAutoProvisioningConfiguration - = new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVaAutoProvisioningConfiguration.type - = Type.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingVaAutoProvisioningConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java deleted file mode 100644 index 2430ece553cf0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Server VM scanning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingVmScanners extends VmScannersGcp { - /** - * Creates an instance of DefenderForServersGcpOfferingVmScanners class. - */ - public DefenderForServersGcpOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingVmScanners if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForServersGcpOfferingVmScanners. - */ - public static DefenderForServersGcpOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingVmScanners deserializedDefenderForServersGcpOfferingVmScanners - = new DefenderForServersGcpOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java deleted file mode 100644 index 6cccb97e328f2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (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.DefenderForStorageSettingInner; - -/** - * An immutable client-side representation of DefenderForStorageSetting. - */ -public interface DefenderForStorageSetting { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Defender for Storage resource properties. - * - * @return the properties value. - */ - DefenderForStorageSettingProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner object. - * - * @return the inner object. - */ - DefenderForStorageSettingInner innerModel(); - - /** - * The entirety of the DefenderForStorageSetting definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - - /** - * The DefenderForStorageSetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DefenderForStorageSetting definition. - */ - interface Blank extends WithScope { - } - - /** - * The stage of the DefenderForStorageSetting definition allowing to specify parent resource. - */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - - /** - * The stage of the DefenderForStorageSetting definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - DefenderForStorageSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DefenderForStorageSetting create(Context context); - } - - /** - * The stage of the DefenderForStorageSetting definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Defender for Storage resource properties.. - * - * @param properties Defender for Storage resource properties. - * @return the next definition stage. - */ - WithCreate withProperties(DefenderForStorageSettingProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DefenderForStorageSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DefenderForStorageSetting refresh(Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation along with {@link Response}. - */ - Response startMalwareScanWithResponse(Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation. - */ - MalwareScan startMalwareScan(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java deleted file mode 100644 index ae9ea364c57e0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Defender for Storage resource properties. - */ -@Fluent -public final class DefenderForStorageSettingProperties - implements JsonSerializable { - /* - * Indicates whether Defender for Storage is enabled on this storage account. - */ - private Boolean isEnabled; - - /* - * Properties of Malware Scanning. - */ - private MalwareScanningProperties malwareScanning; - - /* - * Properties of Sensitive Data Discovery. - */ - private SensitiveDataDiscoveryProperties sensitiveDataDiscovery; - - /* - * Indicates whether the settings defined for this storage account should override the settings defined for the - * subscription. - */ - private Boolean overrideSubscriptionLevelSettings; - - /** - * Creates an instance of DefenderForStorageSettingProperties class. - */ - public DefenderForStorageSettingProperties() { - } - - /** - * Get the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. - * - * @param isEnabled the isEnabled value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the malwareScanning property: Properties of Malware Scanning. - * - * @return the malwareScanning value. - */ - public MalwareScanningProperties malwareScanning() { - return this.malwareScanning; - } - - /** - * Set the malwareScanning property: Properties of Malware Scanning. - * - * @param malwareScanning the malwareScanning value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties withMalwareScanning(MalwareScanningProperties malwareScanning) { - this.malwareScanning = malwareScanning; - return this; - } - - /** - * Get the sensitiveDataDiscovery property: Properties of Sensitive Data Discovery. - * - * @return the sensitiveDataDiscovery value. - */ - public SensitiveDataDiscoveryProperties sensitiveDataDiscovery() { - return this.sensitiveDataDiscovery; - } - - /** - * Set the sensitiveDataDiscovery property: Properties of Sensitive Data Discovery. - * - * @param sensitiveDataDiscovery the sensitiveDataDiscovery value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties - withSensitiveDataDiscovery(SensitiveDataDiscoveryProperties sensitiveDataDiscovery) { - this.sensitiveDataDiscovery = sensitiveDataDiscovery; - return this; - } - - /** - * Get the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage - * account should override the settings defined for the subscription. - * - * @return the overrideSubscriptionLevelSettings value. - */ - public Boolean overrideSubscriptionLevelSettings() { - return this.overrideSubscriptionLevelSettings; - } - - /** - * Set the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage - * account should override the settings defined for the subscription. - * - * @param overrideSubscriptionLevelSettings the overrideSubscriptionLevelSettings value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties - withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings) { - this.overrideSubscriptionLevelSettings = overrideSubscriptionLevelSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (malwareScanning() != null) { - malwareScanning().validate(); - } - if (sensitiveDataDiscovery() != null) { - sensitiveDataDiscovery().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeJsonField("malwareScanning", this.malwareScanning); - jsonWriter.writeJsonField("sensitiveDataDiscovery", this.sensitiveDataDiscovery); - jsonWriter.writeBooleanField("overrideSubscriptionLevelSettings", this.overrideSubscriptionLevelSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForStorageSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForStorageSettingProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DefenderForStorageSettingProperties. - */ - public static DefenderForStorageSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForStorageSettingProperties deserializedDefenderForStorageSettingProperties - = new DefenderForStorageSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isEnabled".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.isEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("malwareScanning".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.malwareScanning - = MalwareScanningProperties.fromJson(reader); - } else if ("sensitiveDataDiscovery".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.sensitiveDataDiscovery - = SensitiveDataDiscoveryProperties.fromJson(reader); - } else if ("overrideSubscriptionLevelSettings".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.overrideSubscriptionLevelSettings - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForStorageSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java deleted file mode 100644 index bb193865a7337..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DefenderForStorages. - */ -public interface DefenderForStorages { - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - Response getWithResponse(String resourceId, SettingName settingName, Context context); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account. - */ - DefenderForStorageSetting get(String resourceId, SettingName settingName); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation along with {@link Response}. - */ - Response startMalwareScanWithResponse(String resourceId, SettingName settingName, Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the state of a malware scan operation. - */ - MalwareScan startMalwareScan(String resourceId, SettingName settingName); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation along with {@link Response}. - */ - Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 describes the state of a malware scan operation. - */ - MalwareScan cancelMalwareScan(String resourceId, SettingName settingName, String scanId); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a 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 Defender for Storage malware scan for the specified storage resource along with {@link Response}. - */ - Response getMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The identifier of the resource. - * @param settingName Defender for Storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource. - */ - MalwareScan getMalwareScan(String resourceId, SettingName settingName, String scanId); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - DefenderForStorageSetting getById(String id); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DefenderForStorageSetting resource. - * - * @param name resource name. - * @return the first stage of the new DefenderForStorageSetting definition. - */ - DefenderForStorageSetting.DefinitionStages.Blank define(SettingName name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DescendantBehavior.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DescendantBehavior.java deleted file mode 100644 index 8f2e03ea92c7e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DescendantBehavior.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The behavior of a policy on descendant resources. - */ -public final class DescendantBehavior extends ExpandableStringEnum { - /** - * Static value Unknown for DescendantBehavior. - */ - public static final DescendantBehavior UNKNOWN = fromString("Unknown"); - - /** - * Static value Override for DescendantBehavior. - */ - public static final DescendantBehavior OVERRIDE = fromString("Override"); - - /** - * Static value FallBack for DescendantBehavior. - */ - public static final DescendantBehavior FALL_BACK = fromString("FallBack"); - - /** - * Creates a new instance of DescendantBehavior value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DescendantBehavior() { - } - - /** - * Creates or finds a DescendantBehavior from its string representation. - * - * @param name a name to look for. - * @return the corresponding DescendantBehavior. - */ - public static DescendantBehavior fromString(String name) { - return fromString(name, DescendantBehavior.class); - } - - /** - * Gets known DescendantBehavior values. - * - * @return known DescendantBehavior values. - */ - public static Collection values() { - return values(DescendantBehavior.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.java deleted file mode 100644 index c1d35b961cf11..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details about DevOps capability. - */ -@Immutable -public final class DevOpsCapability implements JsonSerializable { - /* - * Gets the name of the DevOps capability. - */ - private String name; - - /* - * Gets the value of the DevOps capability. - */ - private String value; - - /** - * Creates an instance of DevOpsCapability class. - */ - public DevOpsCapability() { - } - - /** - * Get the name property: Gets the name of the DevOps capability. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: Gets the value of the DevOps capability. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsCapability from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsCapability if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsCapability. - */ - public static DevOpsCapability fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsCapability deserializedDevOpsCapability = new DevOpsCapability(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedDevOpsCapability.name = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedDevOpsCapability.value = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsCapability; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java deleted file mode 100644 index 4b148f082fd3c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.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.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; - -/** - * An immutable client-side representation of DevOpsConfiguration. - */ -public interface DevOpsConfiguration { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: DevOps Configuration properties. - * - * @return the properties value. - */ - DevOpsConfigurationProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner object. - * - * @return the inner object. - */ - DevOpsConfigurationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java deleted file mode 100644 index 41ca2e8a5a6ff..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class DevOpsConfigurationListResponse implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of DevOpsConfigurationListResponse class. - */ - public DevOpsConfigurationListResponse() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the DevOpsConfigurationListResponse object itself. - */ - public DevOpsConfigurationListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the DevOpsConfigurationListResponse object itself. - */ - public DevOpsConfigurationListResponse withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsConfigurationListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsConfigurationListResponse if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsConfigurationListResponse. - */ - public static DevOpsConfigurationListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsConfigurationListResponse deserializedDevOpsConfigurationListResponse - = new DevOpsConfigurationListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DevOpsConfigurationInner.fromJson(reader1)); - deserializedDevOpsConfigurationListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDevOpsConfigurationListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsConfigurationListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java deleted file mode 100644 index 4fde6e8a057c0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * DevOps Configuration properties. - */ -@Fluent -public final class DevOpsConfigurationProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Authorization payload. - */ - private Authorization authorization; - - /* - * AutoDiscovery states. - */ - private AutoDiscovery autoDiscovery; - - /* - * List of top-level inventory to select when AutoDiscovery is disabled. - * This field is ignored when AutoDiscovery is enabled. - */ - private List topLevelInventoryList; - - /* - * List of capabilities assigned to the DevOps configuration during the discovery process. - */ - private List capabilities; - - /** - * Creates an instance of DevOpsConfigurationProperties class. - */ - public DevOpsConfigurationProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the authorization property: Authorization payload. - * - * @return the authorization value. - */ - public Authorization authorization() { - return this.authorization; - } - - /** - * Set the authorization property: Authorization payload. - * - * @param authorization the authorization value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withAuthorization(Authorization authorization) { - this.authorization = authorization; - return this; - } - - /** - * Get the autoDiscovery property: AutoDiscovery states. - * - * @return the autoDiscovery value. - */ - public AutoDiscovery autoDiscovery() { - return this.autoDiscovery; - } - - /** - * Set the autoDiscovery property: AutoDiscovery states. - * - * @param autoDiscovery the autoDiscovery value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withAutoDiscovery(AutoDiscovery autoDiscovery) { - this.autoDiscovery = autoDiscovery; - return this; - } - - /** - * Get the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled. - * This field is ignored when AutoDiscovery is enabled. - * - * @return the topLevelInventoryList value. - */ - public List topLevelInventoryList() { - return this.topLevelInventoryList; - } - - /** - * Set the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled. - * This field is ignored when AutoDiscovery is enabled. - * - * @param topLevelInventoryList the topLevelInventoryList value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withTopLevelInventoryList(List topLevelInventoryList) { - this.topLevelInventoryList = topLevelInventoryList; - return this; - } - - /** - * Get the capabilities property: List of capabilities assigned to the DevOps configuration during the discovery - * process. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (authorization() != null) { - authorization().validate(); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("authorization", this.authorization); - jsonWriter.writeStringField("autoDiscovery", this.autoDiscovery == null ? null : this.autoDiscovery.toString()); - jsonWriter.writeArrayField("topLevelInventoryList", this.topLevelInventoryList, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsConfigurationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsConfigurationProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsConfigurationProperties. - */ - public static DevOpsConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsConfigurationProperties deserializedDevOpsConfigurationProperties - = new DevOpsConfigurationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("authorization".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.authorization = Authorization.fromJson(reader); - } else if ("autoDiscovery".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.autoDiscovery - = AutoDiscovery.fromString(reader.getString()); - } else if ("topLevelInventoryList".equals(fieldName)) { - List topLevelInventoryList = reader.readArray(reader1 -> reader1.getString()); - deserializedDevOpsConfigurationProperties.topLevelInventoryList = topLevelInventoryList; - } else if ("capabilities".equals(fieldName)) { - List capabilities - = reader.readArray(reader1 -> DevOpsCapability.fromJson(reader1)); - deserializedDevOpsConfigurationProperties.capabilities = capabilities; - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsConfigurationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java deleted file mode 100644 index b1e34bdf97810..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; - -/** - * Resource collection API of DevOpsConfigurations. - */ -public interface DevOpsConfigurations { - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DevOps Configuration. - */ - DevOpsConfiguration get(String resourceGroupName, String securityConnectorName); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java deleted file mode 100644 index da45533089d98..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.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.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DevOpsOperationResults. - */ -public interface DevOpsOperationResults { - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context); - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operation result Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devops long running operation result. - */ - OperationStatusResult get(String resourceGroupName, String securityConnectorName, String operationResultId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicies.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicies.java deleted file mode 100644 index 7341c2df15148..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicies.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 DevOpsPolicies. - */ -public interface DevOpsPolicies { - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of DevOps Policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String devOpsPolicyType, - Context context); - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, String policyName, - Context context); - - /** - * Returns a DevOps Policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyName The policy 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 devOps Policy Resource. - */ - DevOpsPolicy get(String resourceGroupName, String securityConnectorName, String policyName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicy.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicy.java deleted file mode 100644 index b2d171e61da78..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicy.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.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyInner; - -/** - * An immutable client-side representation of DevOpsPolicy. - */ -public interface DevOpsPolicy { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: Policy DevOps Resource properties that contain the full definition of a DevOps - * policy resource. - * - * @return the properties value. - */ - DevOpsPolicyProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DevOpsPolicyInner object. - * - * @return the inner object. - */ - DevOpsPolicyInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignment.java deleted file mode 100644 index 24736758ccb82..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignment.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (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.DevOpsPolicyAssignmentInner; - -/** - * An immutable client-side representation of DevOpsPolicyAssignment. - */ -public interface DevOpsPolicyAssignment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: Properties of the DevOps policy assignment resource. - * - * @return the properties value. - */ - DevOpsPolicyAssignmentProperties properties(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DevOpsPolicyAssignmentInner object. - * - * @return the inner object. - */ - DevOpsPolicyAssignmentInner innerModel(); - - /** - * The entirety of the DevOpsPolicyAssignment definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The DevOpsPolicyAssignment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DevOpsPolicyAssignment definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the DevOpsPolicyAssignment definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @return the next definition stage. - */ - WithCreate withExistingSecurityConnector(String resourceGroupName, String securityConnectorName); - } - - /** - * The stage of the DevOpsPolicyAssignment definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - DevOpsPolicyAssignment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DevOpsPolicyAssignment create(Context context); - } - - /** - * The stage of the DevOpsPolicyAssignment definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the DevOps policy assignment resource.. - * - * @param properties Properties of the DevOps policy assignment resource. - * @return the next definition stage. - */ - WithCreate withProperties(DevOpsPolicyAssignmentProperties properties); - } - } - - /** - * Begins update for the DevOpsPolicyAssignment resource. - * - * @return the stage of resource update. - */ - DevOpsPolicyAssignment.Update update(); - - /** - * The template for DevOpsPolicyAssignment update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - DevOpsPolicyAssignment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - DevOpsPolicyAssignment apply(Context context); - } - - /** - * The DevOpsPolicyAssignment update stages. - */ - interface UpdateStages { - /** - * The stage of the DevOpsPolicyAssignment update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the DevOps policy assignment resource.. - * - * @param properties Properties of the DevOps policy assignment resource. - * @return the next definition stage. - */ - Update withProperties(DevOpsPolicyAssignmentProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DevOpsPolicyAssignment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DevOpsPolicyAssignment refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignmentListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignmentListResponse.java deleted file mode 100644 index 140f32ba68ae9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignmentListResponse.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.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyAssignmentInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class DevOpsPolicyAssignmentListResponse implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of DevOpsPolicyAssignmentListResponse class. - */ - public DevOpsPolicyAssignmentListResponse() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the DevOpsPolicyAssignmentListResponse object itself. - */ - public DevOpsPolicyAssignmentListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the DevOpsPolicyAssignmentListResponse object itself. - */ - public DevOpsPolicyAssignmentListResponse 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyAssignmentListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyAssignmentListResponse if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsPolicyAssignmentListResponse. - */ - public static DevOpsPolicyAssignmentListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyAssignmentListResponse deserializedDevOpsPolicyAssignmentListResponse - = new DevOpsPolicyAssignmentListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DevOpsPolicyAssignmentInner.fromJson(reader1)); - deserializedDevOpsPolicyAssignmentListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyAssignmentListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignmentProperties.java deleted file mode 100644 index 055c4f7cdde30..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignmentProperties.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Properties of the DevOps policy assignment resource. - */ -@Fluent -public final class DevOpsPolicyAssignmentProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Gets or sets the Azure resource id. - */ - private String resourceId; - - /* - * The behavior of a policy on descendant resources. - */ - private DescendantBehavior descendantBehavior; - - /* - * Condensed information to identify a DevOps Policy resource. - */ - private DevOpsPolicyDescriptor policy; - - /* - * Gets or sets time when the assignment was created in UTC. - */ - private OffsetDateTime assignedAt; - - /** - * Creates an instance of DevOpsPolicyAssignmentProperties class. - */ - public DevOpsPolicyAssignmentProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the resourceId property: Gets or sets the Azure resource id. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Gets or sets the Azure resource id. - * - * @param resourceId the resourceId value to set. - * @return the DevOpsPolicyAssignmentProperties object itself. - */ - public DevOpsPolicyAssignmentProperties withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the descendantBehavior property: The behavior of a policy on descendant resources. - * - * @return the descendantBehavior value. - */ - public DescendantBehavior descendantBehavior() { - return this.descendantBehavior; - } - - /** - * Set the descendantBehavior property: The behavior of a policy on descendant resources. - * - * @param descendantBehavior the descendantBehavior value to set. - * @return the DevOpsPolicyAssignmentProperties object itself. - */ - public DevOpsPolicyAssignmentProperties withDescendantBehavior(DescendantBehavior descendantBehavior) { - this.descendantBehavior = descendantBehavior; - return this; - } - - /** - * Get the policy property: Condensed information to identify a DevOps Policy resource. - * - * @return the policy value. - */ - public DevOpsPolicyDescriptor policy() { - return this.policy; - } - - /** - * Set the policy property: Condensed information to identify a DevOps Policy resource. - * - * @param policy the policy value to set. - * @return the DevOpsPolicyAssignmentProperties object itself. - */ - public DevOpsPolicyAssignmentProperties withPolicy(DevOpsPolicyDescriptor policy) { - this.policy = policy; - return this; - } - - /** - * Get the assignedAt property: Gets or sets time when the assignment was created in UTC. - * - * @return the assignedAt value. - */ - public OffsetDateTime assignedAt() { - return this.assignedAt; - } - - /** - * Set the assignedAt property: Gets or sets time when the assignment was created in UTC. - * - * @param assignedAt the assignedAt value to set. - * @return the DevOpsPolicyAssignmentProperties object itself. - */ - public DevOpsPolicyAssignmentProperties withAssignedAt(OffsetDateTime assignedAt) { - this.assignedAt = assignedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policy() != null) { - policy().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("descendantBehavior", - this.descendantBehavior == null ? null : this.descendantBehavior.toString()); - jsonWriter.writeJsonField("policy", this.policy); - jsonWriter.writeStringField("assignedAt", - this.assignedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.assignedAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyAssignmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyAssignmentProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsPolicyAssignmentProperties. - */ - public static DevOpsPolicyAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyAssignmentProperties deserializedDevOpsPolicyAssignmentProperties - = new DevOpsPolicyAssignmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.resourceId = reader.getString(); - } else if ("descendantBehavior".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.descendantBehavior - = DescendantBehavior.fromString(reader.getString()); - } else if ("policy".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.policy = DevOpsPolicyDescriptor.fromJson(reader); - } else if ("assignedAt".equals(fieldName)) { - deserializedDevOpsPolicyAssignmentProperties.assignedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyAssignmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignments.java deleted file mode 100644 index 4d0877b31b1ac..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyAssignments.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (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 DevOpsPolicyAssignments. - */ -public interface DevOpsPolicyAssignments { - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of DevOps Policy Assignments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsPolicyType Optional filter for listing the policies. - * @param resourceId Optional filter for listing the assignments of a specific 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, - String devOpsPolicyType, String resourceId, Context context); - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String policyAssignmentId, Context context); - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource. - */ - DevOpsPolicyAssignment get(String resourceGroupName, String securityConnectorName, String policyAssignmentId); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment 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 delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param policyAssignmentId The policy assignment Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String securityConnectorName, String policyAssignmentId, Context context); - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response}. - */ - DevOpsPolicyAssignment getById(String id); - - /** - * Returns a DevOps Policy Assignment Resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Policy assignment resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a DevOps Policy Assignment Resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DevOpsPolicyAssignment resource. - * - * @param name resource name. - * @return the first stage of the new DevOpsPolicyAssignment definition. - */ - DevOpsPolicyAssignment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyDescriptor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyDescriptor.java deleted file mode 100644 index 60608e9d0734e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyDescriptor.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Condensed information to identify a DevOps Policy resource. - */ -@Fluent -public final class DevOpsPolicyDescriptor implements JsonSerializable { - /* - * Gets or sets the policy name. - */ - private String policyName; - - /* - * Gets or sets the policy GUID. - */ - private String policyId; - - /* - * Gets or sets the version. - */ - private String policyVersion; - - /* - * DevOps Policy resource types. - */ - private DevOpsPolicyType policyType; - - /** - * Creates an instance of DevOpsPolicyDescriptor class. - */ - public DevOpsPolicyDescriptor() { - } - - /** - * Get the policyName property: Gets or sets the policy name. - * - * @return the policyName value. - */ - public String policyName() { - return this.policyName; - } - - /** - * Set the policyName property: Gets or sets the policy name. - * - * @param policyName the policyName value to set. - * @return the DevOpsPolicyDescriptor object itself. - */ - public DevOpsPolicyDescriptor withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - - /** - * Get the policyId property: Gets or sets the policy GUID. - * - * @return the policyId value. - */ - public String policyId() { - return this.policyId; - } - - /** - * Set the policyId property: Gets or sets the policy GUID. - * - * @param policyId the policyId value to set. - * @return the DevOpsPolicyDescriptor object itself. - */ - public DevOpsPolicyDescriptor withPolicyId(String policyId) { - this.policyId = policyId; - return this; - } - - /** - * Get the policyVersion property: Gets or sets the version. - * - * @return the policyVersion value. - */ - public String policyVersion() { - return this.policyVersion; - } - - /** - * Set the policyVersion property: Gets or sets the version. - * - * @param policyVersion the policyVersion value to set. - * @return the DevOpsPolicyDescriptor object itself. - */ - public DevOpsPolicyDescriptor withPolicyVersion(String policyVersion) { - this.policyVersion = policyVersion; - return this; - } - - /** - * Get the policyType property: DevOps Policy resource types. - * - * @return the policyType value. - */ - public DevOpsPolicyType policyType() { - return this.policyType; - } - - /** - * Set the policyType property: DevOps Policy resource types. - * - * @param policyType the policyType value to set. - * @return the DevOpsPolicyDescriptor object itself. - */ - public DevOpsPolicyDescriptor withPolicyType(DevOpsPolicyType policyType) { - this.policyType = policyType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("policyName", this.policyName); - jsonWriter.writeStringField("policyId", this.policyId); - jsonWriter.writeStringField("policyVersion", this.policyVersion); - jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyDescriptor from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyDescriptor if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsPolicyDescriptor. - */ - public static DevOpsPolicyDescriptor fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyDescriptor deserializedDevOpsPolicyDescriptor = new DevOpsPolicyDescriptor(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("policyName".equals(fieldName)) { - deserializedDevOpsPolicyDescriptor.policyName = reader.getString(); - } else if ("policyId".equals(fieldName)) { - deserializedDevOpsPolicyDescriptor.policyId = reader.getString(); - } else if ("policyVersion".equals(fieldName)) { - deserializedDevOpsPolicyDescriptor.policyVersion = reader.getString(); - } else if ("policyType".equals(fieldName)) { - deserializedDevOpsPolicyDescriptor.policyType = DevOpsPolicyType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyDescriptor; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyListResponse.java deleted file mode 100644 index c4fe1bc74fd77..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyListResponse.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DevOpsPolicyInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Fluent -public final class DevOpsPolicyListResponse implements JsonSerializable { - /* - * Gets or sets list of resources. - */ - private List value; - - /* - * Gets or sets next link to scroll over the results. - */ - private String nextLink; - - /** - * Creates an instance of DevOpsPolicyListResponse class. - */ - public DevOpsPolicyListResponse() { - } - - /** - * Get the value property: Gets or sets list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets list of resources. - * - * @param value the value value to set. - * @return the DevOpsPolicyListResponse object itself. - */ - public DevOpsPolicyListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Gets or sets next link to scroll over the results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Gets or sets next link to scroll over the results. - * - * @param nextLink the nextLink value to set. - * @return the DevOpsPolicyListResponse object itself. - */ - public DevOpsPolicyListResponse 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyListResponse if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsPolicyListResponse. - */ - public static DevOpsPolicyListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyListResponse deserializedDevOpsPolicyListResponse = new DevOpsPolicyListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> DevOpsPolicyInner.fromJson(reader1)); - deserializedDevOpsPolicyListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDevOpsPolicyListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyProperties.java deleted file mode 100644 index 2095bb4567fd8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyProperties.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (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.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.UUID; - -/** - * Policy DevOps Resource properties that contain the full definition of a DevOps policy resource. - */ -@Fluent -public final class DevOpsPolicyProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * DevOps Policy creation sources. - */ - private DevOpsPolicySource source; - - /* - * Gets the policy resource GUID. - */ - private UUID policyId; - - /* - * Gets the web URL. - */ - private String webUrl; - - /* - * Gets or sets the semantic version. - */ - private String version; - - /* - * DevOps Policy resource types. - */ - private DevOpsPolicyType type; - - /* - * Gets or sets the policy definition content JSON string. - */ - private String content; - - /** - * Creates an instance of DevOpsPolicyProperties class. - */ - public DevOpsPolicyProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the source property: DevOps Policy creation sources. - * - * @return the source value. - */ - public DevOpsPolicySource source() { - return this.source; - } - - /** - * Set the source property: DevOps Policy creation sources. - * - * @param source the source value to set. - * @return the DevOpsPolicyProperties object itself. - */ - public DevOpsPolicyProperties withSource(DevOpsPolicySource source) { - this.source = source; - return this; - } - - /** - * Get the policyId property: Gets the policy resource GUID. - * - * @return the policyId value. - */ - public UUID policyId() { - return this.policyId; - } - - /** - * Get the webUrl property: Gets the web URL. - * - * @return the webUrl value. - */ - public String webUrl() { - return this.webUrl; - } - - /** - * Get the version property: Gets or sets the semantic version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Gets or sets the semantic version. - * - * @param version the version value to set. - * @return the DevOpsPolicyProperties object itself. - */ - public DevOpsPolicyProperties withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the type property: DevOps Policy resource types. - * - * @return the type value. - */ - public DevOpsPolicyType type() { - return this.type; - } - - /** - * Set the type property: DevOps Policy resource types. - * - * @param type the type value to set. - * @return the DevOpsPolicyProperties object itself. - */ - public DevOpsPolicyProperties withType(DevOpsPolicyType type) { - this.type = type; - return this; - } - - /** - * Get the content property: Gets or sets the policy definition content JSON string. - * - * @return the content value. - */ - public String content() { - return this.content; - } - - /** - * Set the content property: Gets or sets the policy definition content JSON string. - * - * @param content the content value to set. - * @return the DevOpsPolicyProperties object itself. - */ - public DevOpsPolicyProperties withContent(String content) { - this.content = content; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - jsonWriter.writeStringField("version", this.version); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("content", this.content); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsPolicyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsPolicyProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the DevOpsPolicyProperties. - */ - public static DevOpsPolicyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsPolicyProperties deserializedDevOpsPolicyProperties = new DevOpsPolicyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedDevOpsPolicyProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedDevOpsPolicyProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedDevOpsPolicyProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("source".equals(fieldName)) { - deserializedDevOpsPolicyProperties.source = DevOpsPolicySource.fromString(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedDevOpsPolicyProperties.policyId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("webUrl".equals(fieldName)) { - deserializedDevOpsPolicyProperties.webUrl = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedDevOpsPolicyProperties.version = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDevOpsPolicyProperties.type = DevOpsPolicyType.fromString(reader.getString()); - } else if ("content".equals(fieldName)) { - deserializedDevOpsPolicyProperties.content = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsPolicyProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicySource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicySource.java deleted file mode 100644 index b37764bc85d30..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicySource.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * DevOps Policy creation sources. - */ -public final class DevOpsPolicySource extends ExpandableStringEnum { - /** - * Static value Unknown for DevOpsPolicySource. - */ - public static final DevOpsPolicySource UNKNOWN = fromString("Unknown"); - - /** - * Static value BuiltIn for DevOpsPolicySource. - */ - public static final DevOpsPolicySource BUILT_IN = fromString("BuiltIn"); - - /** - * Static value UserDefined for DevOpsPolicySource. - */ - public static final DevOpsPolicySource USER_DEFINED = fromString("UserDefined"); - - /** - * Creates a new instance of DevOpsPolicySource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DevOpsPolicySource() { - } - - /** - * Creates or finds a DevOpsPolicySource from its string representation. - * - * @param name a name to look for. - * @return the corresponding DevOpsPolicySource. - */ - public static DevOpsPolicySource fromString(String name) { - return fromString(name, DevOpsPolicySource.class); - } - - /** - * Gets known DevOpsPolicySource values. - * - * @return known DevOpsPolicySource values. - */ - public static Collection values() { - return values(DevOpsPolicySource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyType.java deleted file mode 100644 index 85fdb24efcb70..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsPolicyType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * DevOps Policy resource types. - */ -public final class DevOpsPolicyType extends ExpandableStringEnum { - /** - * Static value Unknown for DevOpsPolicyType. - */ - public static final DevOpsPolicyType UNKNOWN = fromString("Unknown"); - - /** - * Static value Pipeline for DevOpsPolicyType. - */ - public static final DevOpsPolicyType PIPELINE = fromString("Pipeline"); - - /** - * Creates a new instance of DevOpsPolicyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DevOpsPolicyType() { - } - - /** - * Creates or finds a DevOpsPolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DevOpsPolicyType. - */ - public static DevOpsPolicyType fromString(String name) { - return fromString(name, DevOpsPolicyType.class); - } - - /** - * Gets known DevOpsPolicyType values. - * - * @return known DevOpsPolicyType values. - */ - public static Collection values() { - return values(DevOpsPolicyType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java deleted file mode 100644 index 723624bcf62ce..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ -public final class DevOpsProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Canceled for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState CANCELED = fromString("Canceled"); - - /** - * Static value Pending for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState PENDING = fromString("Pending"); - - /** - * Static value PendingDeletion for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState PENDING_DELETION = fromString("PendingDeletion"); - - /** - * Static value DeletionSuccess for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState DELETION_SUCCESS = fromString("DeletionSuccess"); - - /** - * Static value DeletionFailure for DevOpsProvisioningState. - */ - public static final DevOpsProvisioningState DELETION_FAILURE = fromString("DeletionFailure"); - - /** - * Creates a new instance of DevOpsProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DevOpsProvisioningState() { - } - - /** - * Creates or finds a DevOpsProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DevOpsProvisioningState. - */ - public static DevOpsProvisioningState fromString(String name) { - return fromString(name, DevOpsProvisioningState.class); - } - - /** - * Gets known DevOpsProvisioningState values. - * - * @return known DevOpsProvisioningState values. - */ - public static Collection values() { - return values(DevOpsProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java deleted file mode 100644 index 36dfad75ee633..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Docker Hub connector environment data. - */ -@Fluent -public final class DockerHubEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.DOCKER_HUB_ORGANIZATION; - - /* - * The Docker Hub organization authentication details - */ - private Authentication authentication; - - /* - * Scan interval in hours (value should be between 1-hour to 24-hours) - */ - private Long scanInterval; - - /** - * Creates an instance of DockerHubEnvironmentData class. - */ - public DockerHubEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Get the authentication property: The Docker Hub organization authentication details. - * - * @return the authentication value. - */ - public Authentication authentication() { - return this.authentication; - } - - /** - * Set the authentication property: The Docker Hub organization authentication details. - * - * @param authentication the authentication value to set. - * @return the DockerHubEnvironmentData object itself. - */ - public DockerHubEnvironmentData withAuthentication(Authentication authentication) { - this.authentication = authentication; - return this; - } - - /** - * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @return the scanInterval value. - */ - public Long scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @param scanInterval the scanInterval value to set. - * @return the DockerHubEnvironmentData object itself. - */ - public DockerHubEnvironmentData withScanInterval(Long scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (authentication() != null) { - authentication().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("authentication", this.authentication); - jsonWriter.writeNumberField("scanInterval", this.scanInterval); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DockerHubEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DockerHubEnvironmentData if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DockerHubEnvironmentData. - */ - public static DockerHubEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DockerHubEnvironmentData deserializedDockerHubEnvironmentData = new DockerHubEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedDockerHubEnvironmentData.environmentType - = EnvironmentType.fromString(reader.getString()); - } else if ("authentication".equals(fieldName)) { - deserializedDockerHubEnvironmentData.authentication = Authentication.fromJson(reader); - } else if ("scanInterval".equals(fieldName)) { - deserializedDockerHubEnvironmentData.scanInterval = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedDockerHubEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java deleted file mode 100644 index e86e45fc3a425..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.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.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * End of support status. - */ -public final class EndOfSupportStatus extends ExpandableStringEnum { - /** - * Static value None for EndOfSupportStatus. - */ - public static final EndOfSupportStatus NONE = fromString("None"); - - /** - * Static value noLongerSupported for EndOfSupportStatus. - */ - public static final EndOfSupportStatus NO_LONGER_SUPPORTED = fromString("noLongerSupported"); - - /** - * Static value versionNoLongerSupported for EndOfSupportStatus. - */ - public static final EndOfSupportStatus VERSION_NO_LONGER_SUPPORTED = fromString("versionNoLongerSupported"); - - /** - * Static value upcomingNoLongerSupported for EndOfSupportStatus. - */ - public static final EndOfSupportStatus UPCOMING_NO_LONGER_SUPPORTED = fromString("upcomingNoLongerSupported"); - - /** - * Static value upcomingVersionNoLongerSupported for EndOfSupportStatus. - */ - public static final EndOfSupportStatus UPCOMING_VERSION_NO_LONGER_SUPPORTED - = fromString("upcomingVersionNoLongerSupported"); - - /** - * Creates a new instance of EndOfSupportStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EndOfSupportStatus() { - } - - /** - * Creates or finds a EndOfSupportStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding EndOfSupportStatus. - */ - public static EndOfSupportStatus fromString(String name) { - return fromString(name, EndOfSupportStatus.class); - } - - /** - * Gets known EndOfSupportStatus values. - * - * @return known EndOfSupportStatus values. - */ - public static Collection values() { - return values(EndOfSupportStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java deleted file mode 100644 index c74a017309e84..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The security connector environment data. - */ -@Immutable -public class EnvironmentData implements JsonSerializable { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.fromString("EnvironmentData"); - - /** - * Creates an instance of EnvironmentData class. - */ - public EnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EnvironmentData if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the EnvironmentData. - */ - public static EnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("environmentType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AwsAccount".equals(discriminatorValue)) { - return AwsEnvironmentData.fromJson(readerToUse.reset()); - } else if ("GcpProject".equals(discriminatorValue)) { - return GcpProjectEnvironmentData.fromJson(readerToUse.reset()); - } else if ("GithubScope".equals(discriminatorValue)) { - return GithubScopeEnvironmentData.fromJson(readerToUse.reset()); - } else if ("AzureDevOpsScope".equals(discriminatorValue)) { - return AzureDevOpsScopeEnvironmentData.fromJson(readerToUse.reset()); - } else if ("GitlabScope".equals(discriminatorValue)) { - return GitlabScopeEnvironmentData.fromJson(readerToUse.reset()); - } else if ("DockerHubOrganization".equals(discriminatorValue)) { - return DockerHubEnvironmentData.fromJson(readerToUse.reset()); - } else if ("JFrogArtifactory".equals(discriminatorValue)) { - return JFrogEnvironmentData.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static EnvironmentData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EnvironmentData deserializedEnvironmentData = new EnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedEnvironmentData.environmentType = EnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java deleted file mode 100644 index 36507a4056929..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment details of the resource. - */ -@Fluent -public final class EnvironmentDetails implements JsonSerializable { - /* - * The native resource id of the resource (in case of Azure - the resource Id, in case of MC - the native resource - * id) - */ - private String nativeResourceId; - - /* - * The hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the hierarchyId id) - */ - private String environmentHierarchyId; - - /* - * The organizational hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the - * organizational hierarchyId id) - */ - private String organizationalHierarchyId; - - /* - * The subscription Id - */ - private String subscriptionId; - - /* - * The tenant Id - */ - private String tenantId; - - /** - * Creates an instance of EnvironmentDetails class. - */ - public EnvironmentDetails() { - } - - /** - * Get the nativeResourceId property: The native resource id of the resource (in case of Azure - the resource Id, in - * case of MC - the native resource id). - * - * @return the nativeResourceId value. - */ - public String nativeResourceId() { - return this.nativeResourceId; - } - - /** - * Set the nativeResourceId property: The native resource id of the resource (in case of Azure - the resource Id, in - * case of MC - the native resource id). - * - * @param nativeResourceId the nativeResourceId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withNativeResourceId(String nativeResourceId) { - this.nativeResourceId = nativeResourceId; - return this; - } - - /** - * Get the environmentHierarchyId property: The hierarchy id of the connector (in case of Azure - the subscription - * Id, in case of MC - the hierarchyId id). - * - * @return the environmentHierarchyId value. - */ - public String environmentHierarchyId() { - return this.environmentHierarchyId; - } - - /** - * Set the environmentHierarchyId property: The hierarchy id of the connector (in case of Azure - the subscription - * Id, in case of MC - the hierarchyId id). - * - * @param environmentHierarchyId the environmentHierarchyId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withEnvironmentHierarchyId(String environmentHierarchyId) { - this.environmentHierarchyId = environmentHierarchyId; - return this; - } - - /** - * Get the organizationalHierarchyId property: The organizational hierarchy id of the connector (in case of Azure - - * the subscription Id, in case of MC - the organizational hierarchyId id). - * - * @return the organizationalHierarchyId value. - */ - public String organizationalHierarchyId() { - return this.organizationalHierarchyId; - } - - /** - * Set the organizationalHierarchyId property: The organizational hierarchy id of the connector (in case of Azure - - * the subscription Id, in case of MC - the organizational hierarchyId id). - * - * @param organizationalHierarchyId the organizationalHierarchyId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withOrganizationalHierarchyId(String organizationalHierarchyId) { - this.organizationalHierarchyId = organizationalHierarchyId; - return this; - } - - /** - * Get the subscriptionId property: The subscription Id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription Id. - * - * @param subscriptionId the subscriptionId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the tenantId property: The tenant Id. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenant Id. - * - * @param tenantId the tenantId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nativeResourceId", this.nativeResourceId); - jsonWriter.writeStringField("environmentHierarchyId", this.environmentHierarchyId); - jsonWriter.writeStringField("organizationalHierarchyId", this.organizationalHierarchyId); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("tenantId", this.tenantId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EnvironmentDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EnvironmentDetails if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the EnvironmentDetails. - */ - public static EnvironmentDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EnvironmentDetails deserializedEnvironmentDetails = new EnvironmentDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nativeResourceId".equals(fieldName)) { - deserializedEnvironmentDetails.nativeResourceId = reader.getString(); - } else if ("environmentHierarchyId".equals(fieldName)) { - deserializedEnvironmentDetails.environmentHierarchyId = reader.getString(); - } else if ("organizationalHierarchyId".equals(fieldName)) { - deserializedEnvironmentDetails.organizationalHierarchyId = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedEnvironmentDetails.subscriptionId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedEnvironmentDetails.tenantId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEnvironmentDetails; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java deleted file mode 100644 index 85931d7c25f04..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.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 java.util.Collection; - -/** - * The type of the environment data. - */ -public final class EnvironmentType extends ExpandableStringEnum { - /** - * Static value AwsAccount for EnvironmentType. - */ - public static final EnvironmentType AWS_ACCOUNT = fromString("AwsAccount"); - - /** - * Static value GcpProject for EnvironmentType. - */ - public static final EnvironmentType GCP_PROJECT = fromString("GcpProject"); - - /** - * Static value GithubScope for EnvironmentType. - */ - public static final EnvironmentType GITHUB_SCOPE = fromString("GithubScope"); - - /** - * Static value AzureDevOpsScope for EnvironmentType. - */ - public static final EnvironmentType AZURE_DEV_OPS_SCOPE = fromString("AzureDevOpsScope"); - - /** - * Static value GitlabScope for EnvironmentType. - */ - public static final EnvironmentType GITLAB_SCOPE = fromString("GitlabScope"); - - /** - * Static value DockerHubOrganization for EnvironmentType. - */ - public static final EnvironmentType DOCKER_HUB_ORGANIZATION = fromString("DockerHubOrganization"); - - /** - * Static value JFrogArtifactory for EnvironmentType. - */ - public static final EnvironmentType JFROG_ARTIFACTORY = fromString("JFrogArtifactory"); - - /** - * Creates a new instance of EnvironmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnvironmentType() { - } - - /** - * Creates or finds a EnvironmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnvironmentType. - */ - public static EnvironmentType fromString(String name) { - return fromString(name, EnvironmentType.class); - } - - /** - * Gets known EnvironmentType values. - * - * @return known EnvironmentType values. - */ - public static Collection values() { - return values(EnvironmentType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java deleted file mode 100644 index 2e694c31bb260..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Entity tag is used for comparing two or more entities from the same requested resource. - */ -@Fluent -public class Etag implements JsonSerializable { - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - private String etag; - - /** - * Creates an instance of Etag class. - */ - public Etag() { - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the Etag object itself. - */ - public Etag withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Etag from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Etag if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Etag. - */ - public static Etag fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Etag deserializedEtag = new Etag(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("etag".equals(fieldName)) { - deserializedEtag.etag = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEtag; - }); - } -} 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 deleted file mode 100644 index 206d143e89843..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (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 java.util.Collection; - -/** - * A valid event source type. - */ -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"); - - /** - * Static value SecureScores for EventSource. - */ - public static final EventSource SECURE_SCORES = fromString("SecureScores"); - - /** - * Static value SecureScoresSnapshot for EventSource. - */ - public static final EventSource SECURE_SCORES_SNAPSHOT = fromString("SecureScoresSnapshot"); - - /** - * Static value SecureScoreControls for EventSource. - */ - public static final EventSource SECURE_SCORE_CONTROLS = fromString("SecureScoreControls"); - - /** - * Static value SecureScoreControlsSnapshot for EventSource. - */ - public static final EventSource SECURE_SCORE_CONTROLS_SNAPSHOT = fromString("SecureScoreControlsSnapshot"); - - /** - * Static value RegulatoryComplianceAssessment for EventSource. - */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT = fromString("RegulatoryComplianceAssessment"); - - /** - * Static value RegulatoryComplianceAssessmentSnapshot for EventSource. - */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT - = fromString("RegulatoryComplianceAssessmentSnapshot"); - - /** - * Static value AttackPaths for EventSource. - */ - public static final EventSource ATTACK_PATHS = fromString("AttackPaths"); - - /** - * Static value AttackPathsSnapshot for EventSource. - */ - public static final EventSource ATTACK_PATHS_SNAPSHOT = fromString("AttackPathsSnapshot"); - - /** - * Creates a new instance of EventSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EventSource() { - } - - /** - * Creates or finds a EventSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventSource. - */ - public static EventSource fromString(String name) { - return fromString(name, EventSource.class); - } - - /** - * Gets known EventSource values. - * - * @return known EventSource values. - */ - public static Collection values() { - return values(EventSource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java deleted file mode 100644 index b95c220f8d300..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Governance rule execution parameters. - */ -@Fluent -public final class ExecuteGovernanceRuleParams implements JsonSerializable { - /* - * Describe if governance rule should be override - */ - private Boolean override; - - /** - * Creates an instance of ExecuteGovernanceRuleParams class. - */ - public ExecuteGovernanceRuleParams() { - } - - /** - * Get the override property: Describe if governance rule should be override. - * - * @return the override value. - */ - public Boolean override() { - return this.override; - } - - /** - * Set the override property: Describe if governance rule should be override. - * - * @param override the override value to set. - * @return the ExecuteGovernanceRuleParams object itself. - */ - public ExecuteGovernanceRuleParams withOverride(Boolean override) { - this.override = override; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("override", this.override); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExecuteGovernanceRuleParams from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExecuteGovernanceRuleParams if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ExecuteGovernanceRuleParams. - */ - public static ExecuteGovernanceRuleParams fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExecuteGovernanceRuleParams deserializedExecuteGovernanceRuleParams = new ExecuteGovernanceRuleParams(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("override".equals(fieldName)) { - deserializedExecuteGovernanceRuleParams.override = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedExecuteGovernanceRuleParams; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java index c67c672c2e89f..e61f7346edf38 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java @@ -70,7 +70,7 @@ public final class Extension implements JsonSerializable { /* * Optional. A status describing the success/failure of the extension's enablement/disablement operation. */ - private OperationStatusAutoGenerated operationStatus; + private OperationStatus operationStatus; /** * Creates an instance of Extension class. @@ -216,7 +216,7 @@ public Extension withAdditionalExtensionProperties(Map additiona * * @return the operationStatus value. */ - public OperationStatusAutoGenerated operationStatus() { + public OperationStatus operationStatus() { return this.operationStatus; } @@ -279,7 +279,7 @@ public static Extension fromJson(JsonReader jsonReader) throws IOException { = reader.readMap(reader1 -> reader1.readUntyped()); deserializedExtension.additionalExtensionProperties = additionalExtensionProperties; } else if ("operationStatus".equals(fieldName)) { - deserializedExtension.operationStatus = OperationStatusAutoGenerated.fromJson(reader); + deserializedExtension.operationStatus = OperationStatus.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java deleted file mode 100644 index 33a99060890ca..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID - * and a JSON API key (write only). - */ -@Fluent -public final class GcpCredentialsDetailsProperties extends AuthenticationDetailsProperties { - /* - * Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use - * account organization credentials. - */ - private AuthenticationType authenticationType = AuthenticationType.GCP_CREDENTIALS; - - /* - * The organization ID of the GCP cloud account - */ - private String organizationId; - - /* - * Type field of the API key (write only) - */ - private String type; - - /* - * Project ID field of the API key (write only) - */ - private String projectId; - - /* - * Private key ID field of the API key (write only) - */ - private String privateKeyId; - - /* - * Private key field of the API key (write only) - */ - private String privateKey; - - /* - * Client email field of the API key (write only) - */ - private String clientEmail; - - /* - * Client ID field of the API key (write only) - */ - private String clientId; - - /* - * Auth URI field of the API key (write only) - */ - private String authUri; - - /* - * Token URI field of the API key (write only) - */ - private String tokenUri; - - /* - * Auth provider x509 certificate URL field of the API key (write only) - */ - private String authProviderX509CertUrl; - - /* - * Client x509 certificate URL field of the API key (write only) - */ - private String clientX509CertUrl; - - /** - * Creates an instance of GcpCredentialsDetailsProperties class. - */ - public GcpCredentialsDetailsProperties() { - } - - /** - * Get the authenticationType property: Connect to your cloud account, for AWS use either account credentials or - * role-based authentication. For GCP use account organization credentials. - * - * @return the authenticationType value. - */ - @Override - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Get the organizationId property: The organization ID of the GCP cloud account. - * - * @return the organizationId value. - */ - public String organizationId() { - return this.organizationId; - } - - /** - * Set the organizationId property: The organization ID of the GCP cloud account. - * - * @param organizationId the organizationId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withOrganizationId(String organizationId) { - this.organizationId = organizationId; - return this; - } - - /** - * Get the type property: Type field of the API key (write only). - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type field of the API key (write only). - * - * @param type the type value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the projectId property: Project ID field of the API key (write only). - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Set the projectId property: Project ID field of the API key (write only). - * - * @param projectId the projectId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * Get the privateKeyId property: Private key ID field of the API key (write only). - * - * @return the privateKeyId value. - */ - public String privateKeyId() { - return this.privateKeyId; - } - - /** - * Set the privateKeyId property: Private key ID field of the API key (write only). - * - * @param privateKeyId the privateKeyId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withPrivateKeyId(String privateKeyId) { - this.privateKeyId = privateKeyId; - return this; - } - - /** - * Get the privateKey property: Private key field of the API key (write only). - * - * @return the privateKey value. - */ - public String privateKey() { - return this.privateKey; - } - - /** - * Set the privateKey property: Private key field of the API key (write only). - * - * @param privateKey the privateKey value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withPrivateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } - - /** - * Get the clientEmail property: Client email field of the API key (write only). - * - * @return the clientEmail value. - */ - public String clientEmail() { - return this.clientEmail; - } - - /** - * Set the clientEmail property: Client email field of the API key (write only). - * - * @param clientEmail the clientEmail value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withClientEmail(String clientEmail) { - this.clientEmail = clientEmail; - return this; - } - - /** - * Get the clientId property: Client ID field of the API key (write only). - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: Client ID field of the API key (write only). - * - * @param clientId the clientId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the authUri property: Auth URI field of the API key (write only). - * - * @return the authUri value. - */ - public String authUri() { - return this.authUri; - } - - /** - * Set the authUri property: Auth URI field of the API key (write only). - * - * @param authUri the authUri value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withAuthUri(String authUri) { - this.authUri = authUri; - return this; - } - - /** - * Get the tokenUri property: Token URI field of the API key (write only). - * - * @return the tokenUri value. - */ - public String tokenUri() { - return this.tokenUri; - } - - /** - * Set the tokenUri property: Token URI field of the API key (write only). - * - * @param tokenUri the tokenUri value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withTokenUri(String tokenUri) { - this.tokenUri = tokenUri; - return this; - } - - /** - * Get the authProviderX509CertUrl property: Auth provider x509 certificate URL field of the API key (write only). - * - * @return the authProviderX509CertUrl value. - */ - public String authProviderX509CertUrl() { - return this.authProviderX509CertUrl; - } - - /** - * Set the authProviderX509CertUrl property: Auth provider x509 certificate URL field of the API key (write only). - * - * @param authProviderX509CertUrl the authProviderX509CertUrl value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withAuthProviderX509CertUrl(String authProviderX509CertUrl) { - this.authProviderX509CertUrl = authProviderX509CertUrl; - return this; - } - - /** - * Get the clientX509CertUrl property: Client x509 certificate URL field of the API key (write only). - * - * @return the clientX509CertUrl value. - */ - public String clientX509CertUrl() { - return this.clientX509CertUrl; - } - - /** - * Set the clientX509CertUrl property: Client x509 certificate URL field of the API key (write only). - * - * @param clientX509CertUrl the clientX509CertUrl value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withClientX509CertUrl(String clientX509CertUrl) { - this.clientX509CertUrl = clientX509CertUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (organizationId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property organizationId in model GcpCredentialsDetailsProperties")); - } - if (type() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property type in model GcpCredentialsDetailsProperties")); - } - if (projectId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property projectId in model GcpCredentialsDetailsProperties")); - } - if (privateKeyId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateKeyId in model GcpCredentialsDetailsProperties")); - } - if (privateKey() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateKey in model GcpCredentialsDetailsProperties")); - } - if (clientEmail() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property clientEmail in model GcpCredentialsDetailsProperties")); - } - if (clientId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property clientId in model GcpCredentialsDetailsProperties")); - } - if (authUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property authUri in model GcpCredentialsDetailsProperties")); - } - if (tokenUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property tokenUri in model GcpCredentialsDetailsProperties")); - } - if (authProviderX509CertUrl() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property authProviderX509CertUrl in model GcpCredentialsDetailsProperties")); - } - if (clientX509CertUrl() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property clientX509CertUrl in model GcpCredentialsDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GcpCredentialsDetailsProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationId", this.organizationId); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("projectId", this.projectId); - jsonWriter.writeStringField("privateKeyId", this.privateKeyId); - jsonWriter.writeStringField("privateKey", this.privateKey); - jsonWriter.writeStringField("clientEmail", this.clientEmail); - jsonWriter.writeStringField("clientId", this.clientId); - jsonWriter.writeStringField("authUri", this.authUri); - jsonWriter.writeStringField("tokenUri", this.tokenUri); - jsonWriter.writeStringField("authProviderX509CertUrl", this.authProviderX509CertUrl); - jsonWriter.writeStringField("clientX509CertUrl", this.clientX509CertUrl); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpCredentialsDetailsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpCredentialsDetailsProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the GcpCredentialsDetailsProperties. - */ - public static GcpCredentialsDetailsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpCredentialsDetailsProperties deserializedGcpCredentialsDetailsProperties - = new GcpCredentialsDetailsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationProvisioningState".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.withAuthenticationProvisioningState( - AuthenticationProvisioningState.fromString(reader.getString())); - } else if ("grantedPermissions".equals(fieldName)) { - List grantedPermissions - = reader.readArray(reader1 -> PermissionProperty.fromString(reader1.getString())); - deserializedGcpCredentialsDetailsProperties.withGrantedPermissions(grantedPermissions); - } else if ("organizationId".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.organizationId = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.type = reader.getString(); - } else if ("projectId".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.projectId = reader.getString(); - } else if ("privateKeyId".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.privateKeyId = reader.getString(); - } else if ("privateKey".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.privateKey = reader.getString(); - } else if ("clientEmail".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.clientEmail = reader.getString(); - } else if ("clientId".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.clientId = reader.getString(); - } else if ("authUri".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.authUri = reader.getString(); - } else if ("tokenUri".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.tokenUri = reader.getString(); - } else if ("authProviderX509CertUrl".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.authProviderX509CertUrl = reader.getString(); - } else if ("clientX509CertUrl".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.clientX509CertUrl = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedGcpCredentialsDetailsProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpCredentialsDetailsProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java deleted file mode 100644 index 258cb7ae15250..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The gcpOrganization data. - */ -@Immutable -public class GcpOrganizationalData implements JsonSerializable { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType - = OrganizationMembershipType.fromString("GcpOrganizationalData"); - - /** - * Creates an instance of GcpOrganizationalData class. - */ - public GcpOrganizationalData() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpOrganizationalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpOrganizationalData if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the GcpOrganizationalData. - */ - public static GcpOrganizationalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("organizationMembershipType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Organization".equals(discriminatorValue)) { - return GcpOrganizationalDataOrganization.fromJson(readerToUse.reset()); - } else if ("Member".equals(discriminatorValue)) { - return GcpOrganizationalDataMember.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static GcpOrganizationalData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpOrganizationalData deserializedGcpOrganizationalData = new GcpOrganizationalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedGcpOrganizationalData.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpOrganizationalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java deleted file mode 100644 index fcd7170df607c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The gcpOrganization data for the member account. - */ -@Fluent -public final class GcpOrganizationalDataMember extends GcpOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.MEMBER; - - /* - * If the multi cloud account is not of membership type organization, this will be the ID of the project's parent - */ - private String parentHierarchyId; - - /* - * The GCP management project number from organizational onboarding - */ - private String managementProjectNumber; - - /** - * Creates an instance of GcpOrganizationalDataMember class. - */ - public GcpOrganizationalDataMember() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the project'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 project's parent. - * - * @param parentHierarchyId the parentHierarchyId value to set. - * @return the GcpOrganizationalDataMember object itself. - */ - public GcpOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) { - this.parentHierarchyId = parentHierarchyId; - return this; - } - - /** - * Get the managementProjectNumber property: The GCP management project number from organizational onboarding. - * - * @return the managementProjectNumber value. - */ - public String managementProjectNumber() { - return this.managementProjectNumber; - } - - /** - * Set the managementProjectNumber property: The GCP management project number from organizational onboarding. - * - * @param managementProjectNumber the managementProjectNumber value to set. - * @return the GcpOrganizationalDataMember object itself. - */ - public GcpOrganizationalDataMember withManagementProjectNumber(String managementProjectNumber) { - this.managementProjectNumber = managementProjectNumber; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeStringField("parentHierarchyId", this.parentHierarchyId); - jsonWriter.writeStringField("managementProjectNumber", this.managementProjectNumber); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpOrganizationalDataMember from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpOrganizationalDataMember if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GcpOrganizationalDataMember. - */ - public static GcpOrganizationalDataMember fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpOrganizationalDataMember deserializedGcpOrganizationalDataMember = new GcpOrganizationalDataMember(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedGcpOrganizationalDataMember.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("parentHierarchyId".equals(fieldName)) { - deserializedGcpOrganizationalDataMember.parentHierarchyId = reader.getString(); - } else if ("managementProjectNumber".equals(fieldName)) { - deserializedGcpOrganizationalDataMember.managementProjectNumber = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpOrganizationalDataMember; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java deleted file mode 100644 index 2c8c07ef232b1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The gcpOrganization data for the parent account. - */ -@Fluent -public final class GcpOrganizationalDataOrganization extends GcpOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.ORGANIZATION; - - /* - * If the multi cloud account is of membership type organization, list of accounts excluded from offering - */ - private List excludedProjectNumbers; - - /* - * The service account email address which represents the organization level permissions container. - */ - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id which represents the permissions required to auto provision security - * connectors - */ - private String workloadIdentityProviderId; - - /* - * GCP organization name - */ - private String organizationName; - - /** - * Creates an instance of GcpOrganizationalDataOrganization class. - */ - public GcpOrganizationalDataOrganization() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Get the excludedProjectNumbers property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @return the excludedProjectNumbers value. - */ - public List excludedProjectNumbers() { - return this.excludedProjectNumbers; - } - - /** - * Set the excludedProjectNumbers property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @param excludedProjectNumbers the excludedProjectNumbers value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withExcludedProjectNumbers(List excludedProjectNumbers) { - this.excludedProjectNumbers = excludedProjectNumbers; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address which represents the organization - * level permissions container. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address which represents the organization - * level permissions container. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id which represents the - * permissions required to auto provision security connectors. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id which represents the - * permissions required to auto provision security connectors. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the organizationName property: GCP organization name. - * - * @return the organizationName value. - */ - public String organizationName() { - return this.organizationName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeArrayField("excludedProjectNumbers", this.excludedProjectNumbers, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpOrganizationalDataOrganization from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpOrganizationalDataOrganization if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GcpOrganizationalDataOrganization. - */ - public static GcpOrganizationalDataOrganization fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpOrganizationalDataOrganization deserializedGcpOrganizationalDataOrganization - = new GcpOrganizationalDataOrganization(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("excludedProjectNumbers".equals(fieldName)) { - List excludedProjectNumbers = reader.readArray(reader1 -> reader1.getString()); - deserializedGcpOrganizationalDataOrganization.excludedProjectNumbers = excludedProjectNumbers; - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.serviceAccountEmailAddress = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.workloadIdentityProviderId = reader.getString(); - } else if ("organizationName".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.organizationName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpOrganizationalDataOrganization; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java deleted file mode 100644 index 885ac4f9a2d08..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The details about the project represented by the security connector. - */ -@Fluent -public final class GcpProjectDetails implements JsonSerializable { - /* - * The unique GCP Project number - */ - private String projectNumber; - - /* - * The GCP Project id - */ - private String projectId; - - /* - * The GCP workload identity federation pool id - */ - private String workloadIdentityPoolId; - - /* - * GCP project name - */ - private String projectName; - - /** - * Creates an instance of GcpProjectDetails class. - */ - public GcpProjectDetails() { - } - - /** - * Get the projectNumber property: The unique GCP Project number. - * - * @return the projectNumber value. - */ - public String projectNumber() { - return this.projectNumber; - } - - /** - * Set the projectNumber property: The unique GCP Project number. - * - * @param projectNumber the projectNumber value to set. - * @return the GcpProjectDetails object itself. - */ - public GcpProjectDetails withProjectNumber(String projectNumber) { - this.projectNumber = projectNumber; - return this; - } - - /** - * Get the projectId property: The GCP Project id. - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Set the projectId property: The GCP Project id. - * - * @param projectId the projectId value to set. - * @return the GcpProjectDetails object itself. - */ - public GcpProjectDetails withProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * Get the workloadIdentityPoolId property: The GCP workload identity federation pool id. - * - * @return the workloadIdentityPoolId value. - */ - public String workloadIdentityPoolId() { - return this.workloadIdentityPoolId; - } - - /** - * Get the projectName property: GCP project name. - * - * @return the projectName value. - */ - public String projectName() { - return this.projectName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("projectNumber", this.projectNumber); - jsonWriter.writeStringField("projectId", this.projectId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpProjectDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpProjectDetails if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the GcpProjectDetails. - */ - public static GcpProjectDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpProjectDetails deserializedGcpProjectDetails = new GcpProjectDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("projectNumber".equals(fieldName)) { - deserializedGcpProjectDetails.projectNumber = reader.getString(); - } else if ("projectId".equals(fieldName)) { - deserializedGcpProjectDetails.projectId = reader.getString(); - } else if ("workloadIdentityPoolId".equals(fieldName)) { - deserializedGcpProjectDetails.workloadIdentityPoolId = reader.getString(); - } else if ("projectName".equals(fieldName)) { - deserializedGcpProjectDetails.projectName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpProjectDetails; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java deleted file mode 100644 index 9a24e2439a12c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The GCP project connector environment data. - */ -@Fluent -public final class GcpProjectEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.GCP_PROJECT; - - /* - * The Gcp project's organizational data - */ - private GcpOrganizationalData organizationalData; - - /* - * The Gcp project's details - */ - private GcpProjectDetails projectDetails; - - /* - * Scan interval in hours (value should be between 1-hour to 24-hours) - */ - private Long scanInterval; - - /** - * Creates an instance of GcpProjectEnvironmentData class. - */ - public GcpProjectEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Get the organizationalData property: The Gcp project's organizational data. - * - * @return the organizationalData value. - */ - public GcpOrganizationalData organizationalData() { - return this.organizationalData; - } - - /** - * Set the organizationalData property: The Gcp project's organizational data. - * - * @param organizationalData the organizationalData value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withOrganizationalData(GcpOrganizationalData organizationalData) { - this.organizationalData = organizationalData; - return this; - } - - /** - * Get the projectDetails property: The Gcp project's details. - * - * @return the projectDetails value. - */ - public GcpProjectDetails projectDetails() { - return this.projectDetails; - } - - /** - * Set the projectDetails property: The Gcp project's details. - * - * @param projectDetails the projectDetails value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withProjectDetails(GcpProjectDetails projectDetails) { - this.projectDetails = projectDetails; - return this; - } - - /** - * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @return the scanInterval value. - */ - public Long scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @param scanInterval the scanInterval value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withScanInterval(Long scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (organizationalData() != null) { - organizationalData().validate(); - } - if (projectDetails() != null) { - projectDetails().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("organizationalData", this.organizationalData); - jsonWriter.writeJsonField("projectDetails", this.projectDetails); - jsonWriter.writeNumberField("scanInterval", this.scanInterval); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpProjectEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpProjectEnvironmentData if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GcpProjectEnvironmentData. - */ - public static GcpProjectEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpProjectEnvironmentData deserializedGcpProjectEnvironmentData = new GcpProjectEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.environmentType - = EnvironmentType.fromString(reader.getString()); - } else if ("organizationalData".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.organizationalData = GcpOrganizationalData.fromJson(reader); - } else if ("projectDetails".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.projectDetails = GcpProjectDetails.fromJson(reader); - } else if ("scanInterval".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.scanInterval = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpProjectEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java deleted file mode 100644 index f60c947fad029..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.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.models; - -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import java.util.List; - -/** - * An immutable client-side representation of GetSensitivitySettingsListResponse. - */ -public interface GetSensitivitySettingsListResponse { - /** - * Gets the value property: The value property. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner object. - * - * @return the inner object. - */ - GetSensitivitySettingsListResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java deleted file mode 100644 index 7db855c1ede45..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; - -/** - * An immutable client-side representation of GetSensitivitySettingsResponse. - */ -public interface GetSensitivitySettingsResponse { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: The sensitivity settings properties. - * - * @return the properties value. - */ - GetSensitivitySettingsResponseProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner object. - * - * @return the inner object. - */ - GetSensitivitySettingsResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java deleted file mode 100644 index 8d9ded012d3a2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Objects; -import java.util.UUID; - -/** - * The sensitivity settings properties. - */ -@Fluent -public final class GetSensitivitySettingsResponseProperties - implements JsonSerializable { - /* - * List of selected sensitive info types' IDs. - */ - private List sensitiveInfoTypesIds; - - /* - * The order of the sensitivity threshold label. Any label at or above this order will be considered sensitive. If - * set to -1, sensitivity by labels is turned off - */ - private Float sensitivityThresholdLabelOrder; - - /* - * The id of the sensitivity threshold label. Any label at or above this rank will be considered sensitive. - */ - private UUID sensitivityThresholdLabelId; - - /* - * Microsoft information protection built-in and custom information types, labels, and integration status. - */ - private GetSensitivitySettingsResponsePropertiesMipInformation mipInformation; - - /** - * Creates an instance of GetSensitivitySettingsResponseProperties class. - */ - public GetSensitivitySettingsResponseProperties() { - } - - /** - * Get the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. - * - * @return the sensitiveInfoTypesIds value. - */ - public List sensitiveInfoTypesIds() { - return this.sensitiveInfoTypesIds; - } - - /** - * Set the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. - * - * @param sensitiveInfoTypesIds the sensitiveInfoTypesIds value to set. - * @return the GetSensitivitySettingsResponseProperties object itself. - */ - public GetSensitivitySettingsResponseProperties withSensitiveInfoTypesIds(List sensitiveInfoTypesIds) { - this.sensitiveInfoTypesIds = sensitiveInfoTypesIds; - return this; - } - - /** - * Get the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or - * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. - * - * @return the sensitivityThresholdLabelOrder value. - */ - public Float sensitivityThresholdLabelOrder() { - return this.sensitivityThresholdLabelOrder; - } - - /** - * Set the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or - * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. - * - * @param sensitivityThresholdLabelOrder the sensitivityThresholdLabelOrder value to set. - * @return the GetSensitivitySettingsResponseProperties object itself. - */ - public GetSensitivitySettingsResponseProperties - withSensitivityThresholdLabelOrder(Float sensitivityThresholdLabelOrder) { - this.sensitivityThresholdLabelOrder = sensitivityThresholdLabelOrder; - return this; - } - - /** - * Get the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above - * this rank will be considered sensitive. - * - * @return the sensitivityThresholdLabelId value. - */ - public UUID sensitivityThresholdLabelId() { - return this.sensitivityThresholdLabelId; - } - - /** - * Set the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above - * this rank will be considered sensitive. - * - * @param sensitivityThresholdLabelId the sensitivityThresholdLabelId value to set. - * @return the GetSensitivitySettingsResponseProperties object itself. - */ - public GetSensitivitySettingsResponseProperties withSensitivityThresholdLabelId(UUID sensitivityThresholdLabelId) { - this.sensitivityThresholdLabelId = sensitivityThresholdLabelId; - return this; - } - - /** - * Get the mipInformation property: Microsoft information protection built-in and custom information types, labels, - * and integration status. - * - * @return the mipInformation value. - */ - public GetSensitivitySettingsResponsePropertiesMipInformation mipInformation() { - return this.mipInformation; - } - - /** - * Set the mipInformation property: Microsoft information protection built-in and custom information types, labels, - * and integration status. - * - * @param mipInformation the mipInformation value to set. - * @return the GetSensitivitySettingsResponseProperties object itself. - */ - public GetSensitivitySettingsResponseProperties - withMipInformation(GetSensitivitySettingsResponsePropertiesMipInformation mipInformation) { - this.mipInformation = mipInformation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (mipInformation() != null) { - mipInformation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("sensitiveInfoTypesIds", this.sensitiveInfoTypesIds, - (writer, element) -> writer.writeString(Objects.toString(element, null))); - jsonWriter.writeNumberField("sensitivityThresholdLabelOrder", this.sensitivityThresholdLabelOrder); - jsonWriter.writeStringField("sensitivityThresholdLabelId", - Objects.toString(this.sensitivityThresholdLabelId, null)); - jsonWriter.writeJsonField("mipInformation", this.mipInformation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GetSensitivitySettingsResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GetSensitivitySettingsResponseProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the GetSensitivitySettingsResponseProperties. - */ - public static GetSensitivitySettingsResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GetSensitivitySettingsResponseProperties deserializedGetSensitivitySettingsResponseProperties - = new GetSensitivitySettingsResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sensitiveInfoTypesIds".equals(fieldName)) { - List sensitiveInfoTypesIds = reader.readArray( - reader1 -> reader1.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()))); - deserializedGetSensitivitySettingsResponseProperties.sensitiveInfoTypesIds = sensitiveInfoTypesIds; - } else if ("sensitivityThresholdLabelOrder".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseProperties.sensitivityThresholdLabelOrder - = reader.getNullable(JsonReader::getFloat); - } else if ("sensitivityThresholdLabelId".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseProperties.sensitivityThresholdLabelId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("mipInformation".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseProperties.mipInformation - = GetSensitivitySettingsResponsePropertiesMipInformation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGetSensitivitySettingsResponseProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java deleted file mode 100644 index b4197d36609d2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Microsoft information protection built-in and custom information types, labels, and integration status. - */ -@Fluent -public final class GetSensitivitySettingsResponsePropertiesMipInformation - implements JsonSerializable { - /* - * Microsoft information protection integration status - */ - private MipIntegrationStatus mipIntegrationStatus; - - /* - * List of Microsoft information protection sensitivity labels - */ - private List