diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index 33b7843e8f5e..a17cd1d00f2f 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-09-12) +- Azure Resource Manager Security client library for Java. This package contains Microsoft Azure SDK for Security Management SDK. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-07-14) diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index dae5056f7c71..538f15f09116 100644 --- a/sdk/security/azure-resourcemanager-security/README.md +++ b/sdk/security/azure-resourcemanager-security/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-security - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,7 +74,6 @@ See [API design][design] for general introduction on design and key concepts on ## Examples -[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/SAMPLE.md) ## Troubleshooting 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 cdcf2fc45d00..cc7bdf17136e 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 @@ -34,28 +34,18 @@ 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.DeviceSecurityGroupsImpl; -import com.azure.resourcemanager.security.implementation.DevicesForHubsImpl; -import com.azure.resourcemanager.security.implementation.DevicesForSubscriptionsImpl; -import com.azure.resourcemanager.security.implementation.DevicesImpl; import com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; import com.azure.resourcemanager.security.implementation.IngestionSettingsImpl; -import com.azure.resourcemanager.security.implementation.IotAlertTypesImpl; -import com.azure.resourcemanager.security.implementation.IotAlertsImpl; -import com.azure.resourcemanager.security.implementation.IotDefenderSettingsImpl; -import com.azure.resourcemanager.security.implementation.IotRecommendationTypesImpl; -import com.azure.resourcemanager.security.implementation.IotRecommendationsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.IotSensorsImpl; -import com.azure.resourcemanager.security.implementation.IotSitesImpl; import com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesImpl; import com.azure.resourcemanager.security.implementation.LocationsImpl; -import com.azure.resourcemanager.security.implementation.OnPremiseIotSensorsImpl; import com.azure.resourcemanager.security.implementation.OperationsImpl; import com.azure.resourcemanager.security.implementation.PricingsImpl; import com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsImpl; @@ -91,28 +81,18 @@ 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.DeviceSecurityGroups; -import com.azure.resourcemanager.security.models.Devices; -import com.azure.resourcemanager.security.models.DevicesForHubs; -import com.azure.resourcemanager.security.models.DevicesForSubscriptions; import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; import com.azure.resourcemanager.security.models.InformationProtectionPolicies; import com.azure.resourcemanager.security.models.IngestionSettings; -import com.azure.resourcemanager.security.models.IotAlertTypes; -import com.azure.resourcemanager.security.models.IotAlerts; -import com.azure.resourcemanager.security.models.IotDefenderSettings; -import com.azure.resourcemanager.security.models.IotRecommendationTypes; -import com.azure.resourcemanager.security.models.IotRecommendations; import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; import com.azure.resourcemanager.security.models.IotSecuritySolutions; import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; -import com.azure.resourcemanager.security.models.IotSensors; -import com.azure.resourcemanager.security.models.IotSites; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; import com.azure.resourcemanager.security.models.Locations; -import com.azure.resourcemanager.security.models.OnPremiseIotSensors; import com.azure.resourcemanager.security.models.Operations; import com.azure.resourcemanager.security.models.Pricings; import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; @@ -142,6 +122,8 @@ /** Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) resource provider. */ public final class SecurityManager { + private CustomAssessmentAutomations customAssessmentAutomations; + private ComplianceResults complianceResults; private Pricings pricings; @@ -224,28 +206,6 @@ public final class SecurityManager { private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - private IotDefenderSettings iotDefenderSettings; - - private IotSensors iotSensors; - - private DevicesForSubscriptions devicesForSubscriptions; - - private DevicesForHubs devicesForHubs; - - private Devices devices; - - private OnPremiseIotSensors onPremiseIotSensors; - - private IotSites iotSites; - - private IotAlerts iotAlerts; - - private IotAlertTypes iotAlertTypes; - - private IotRecommendations iotRecommendations; - - private IotRecommendationTypes iotRecommendationTypes; - private Alerts alerts; private Settings settings; @@ -429,6 +389,15 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro } } + /** @return Resource collection API of CustomAssessmentAutomations. */ + public CustomAssessmentAutomations customAssessmentAutomations() { + if (this.customAssessmentAutomations == null) { + this.customAssessmentAutomations = + new CustomAssessmentAutomationsImpl(clientObject.getCustomAssessmentAutomations(), this); + } + return customAssessmentAutomations; + } + /** @return Resource collection API of ComplianceResults. */ public ComplianceResults complianceResults() { if (this.complianceResults == null) { @@ -782,96 +751,6 @@ public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselin return sqlVulnerabilityAssessmentBaselineRules; } - /** @return Resource collection API of IotDefenderSettings. */ - public IotDefenderSettings iotDefenderSettings() { - if (this.iotDefenderSettings == null) { - this.iotDefenderSettings = new IotDefenderSettingsImpl(clientObject.getIotDefenderSettings(), this); - } - return iotDefenderSettings; - } - - /** @return Resource collection API of IotSensors. */ - public IotSensors iotSensors() { - if (this.iotSensors == null) { - this.iotSensors = new IotSensorsImpl(clientObject.getIotSensors(), this); - } - return iotSensors; - } - - /** @return Resource collection API of DevicesForSubscriptions. */ - public DevicesForSubscriptions devicesForSubscriptions() { - if (this.devicesForSubscriptions == null) { - this.devicesForSubscriptions = - new DevicesForSubscriptionsImpl(clientObject.getDevicesForSubscriptions(), this); - } - return devicesForSubscriptions; - } - - /** @return Resource collection API of DevicesForHubs. */ - public DevicesForHubs devicesForHubs() { - if (this.devicesForHubs == null) { - this.devicesForHubs = new DevicesForHubsImpl(clientObject.getDevicesForHubs(), this); - } - return devicesForHubs; - } - - /** @return Resource collection API of Devices. */ - public Devices devices() { - if (this.devices == null) { - this.devices = new DevicesImpl(clientObject.getDevices(), this); - } - return devices; - } - - /** @return Resource collection API of OnPremiseIotSensors. */ - public OnPremiseIotSensors onPremiseIotSensors() { - if (this.onPremiseIotSensors == null) { - this.onPremiseIotSensors = new OnPremiseIotSensorsImpl(clientObject.getOnPremiseIotSensors(), this); - } - return onPremiseIotSensors; - } - - /** @return Resource collection API of IotSites. */ - public IotSites iotSites() { - if (this.iotSites == null) { - this.iotSites = new IotSitesImpl(clientObject.getIotSites(), this); - } - return iotSites; - } - - /** @return Resource collection API of IotAlerts. */ - public IotAlerts iotAlerts() { - if (this.iotAlerts == null) { - this.iotAlerts = new IotAlertsImpl(clientObject.getIotAlerts(), this); - } - return iotAlerts; - } - - /** @return Resource collection API of IotAlertTypes. */ - public IotAlertTypes iotAlertTypes() { - if (this.iotAlertTypes == null) { - this.iotAlertTypes = new IotAlertTypesImpl(clientObject.getIotAlertTypes(), this); - } - return iotAlertTypes; - } - - /** @return Resource collection API of IotRecommendations. */ - public IotRecommendations iotRecommendations() { - if (this.iotRecommendations == null) { - this.iotRecommendations = new IotRecommendationsImpl(clientObject.getIotRecommendations(), this); - } - return iotRecommendations; - } - - /** @return Resource collection API of IotRecommendationTypes. */ - public IotRecommendationTypes iotRecommendationTypes() { - if (this.iotRecommendationTypes == null) { - this.iotRecommendationTypes = - new IotRecommendationTypesImpl(clientObject.getIotRecommendationTypes(), this); - } - return iotRecommendationTypes; - } - /** @return Resource collection API of Alerts. */ public Alerts alerts() { if (this.alerts == null) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java index 5d3b6586bae3..2a460bf72778 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java @@ -9,8 +9,9 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.ExpandEnum; +import com.azure.resourcemanager.security.models.SecurityAssessment; /** An instance of this class provides access to all the operations defined in AssessmentsClient. */ public interface AssessmentsClient { @@ -25,7 +26,7 @@ public interface AssessmentsClient { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable list(String scope); /** * Get security assessments on all your scanned resources inside a scope. @@ -39,7 +40,7 @@ public interface AssessmentsClient { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); + PagedIterable list(String scope, Context context); /** * Get a security assessment on your scanned resource. @@ -52,7 +53,7 @@ public interface AssessmentsClient { * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentInner get(String resourceId, String assessmentName); + SecurityAssessmentResponseInner get(String resourceId, String assessmentName); /** * Get a security assessment on your scanned resource. @@ -67,7 +68,7 @@ public interface AssessmentsClient { * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( + Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context); /** @@ -80,11 +81,11 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessmentInner assessment); + SecurityAssessmentResponseInner createOrUpdate( + String resourceId, String assessmentName, SecurityAssessment assessment); /** * Create a security assessment on your resource. An assessment metadata that describes this assessment must be @@ -97,11 +98,11 @@ SecurityAssessmentInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceId, String assessmentName, SecurityAssessmentInner assessment, Context context); + Response createOrUpdateWithResponse( + String resourceId, String assessmentName, SecurityAssessment assessment, Context context); /** * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java index 6cc6f62ecf44..595cfc2b325c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java @@ -9,7 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; /** An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. */ public interface AssessmentsMetadatasClient { @@ -21,7 +21,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** * Get metadata information on all assessment types. @@ -33,7 +33,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); /** * Get metadata information on an assessment type. @@ -45,7 +45,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataInner get(String assessmentMetadataName); + SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName); /** * Get metadata information on an assessment type. @@ -58,7 +58,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String assessmentMetadataName, Context context); + Response getWithResponse(String assessmentMetadataName, Context context); /** * Get metadata information on all assessment types in a specific subscription. @@ -68,7 +68,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); + PagedIterable listBySubscription(); /** * Get metadata information on all assessment types in a specific subscription. @@ -80,7 +80,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Context context); + PagedIterable listBySubscription(Context context); /** * Get metadata information on an assessment type in a specific subscription. @@ -92,7 +92,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataInner getInSubscription(String assessmentMetadataName); + SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName); /** * Get metadata information on an assessment type in a specific subscription. @@ -105,7 +105,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getInSubscriptionWithResponse( + Response getInSubscriptionWithResponse( String assessmentMetadataName, Context context); /** @@ -116,11 +116,11 @@ Response getInSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata); + SecurityAssessmentMetadataResponseInner createInSubscription( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata); /** * Create metadata information on an assessment type in a specific subscription. @@ -131,11 +131,11 @@ SecurityAssessmentMetadataInner createInSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata, Context context); + Response createInSubscriptionWithResponse( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context); /** * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java new file mode 100644 index 000000000000..a65b209583e3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ +public interface CustomAssessmentAutomationsClient { + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomAssessmentAutomationInner getByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context); + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomAssessmentAutomationInner create( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody); + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody, + Context context); + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String customAssessmentAutomationName); + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, Context context); + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List custom assessment automations by provided subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List custom assessment automations by provided subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.java deleted file mode 100644 index 90532443f9ff..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; - -/** An instance of this class provides access to all the operations defined in DevicesClient. */ -public interface DevicesClient { - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner get(String resourceId, String deviceId); - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String deviceId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.java deleted file mode 100644 index 69f002544a43..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.ManagementState; - -/** An instance of this class provides access to all the operations defined in DevicesForHubsClient. */ -public interface DevicesForHubsClient { - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.java deleted file mode 100644 index 155c79771103..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.ManagementState; - -/** An instance of this class provides access to all the operations defined in DevicesForSubscriptionsClient. */ -public interface DevicesForSubscriptionsClient { - /** - * Get list of the devices by their subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertTypesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertTypesClient.java deleted file mode 100644 index c61e6ae4bc96..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertTypesClient.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.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; - -/** An instance of this class provides access to all the operations defined in IotAlertTypesClient. */ -public interface IotAlertTypesClient { - /** - * List IoT alert types. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotAlertTypeListInner list(); - - /** - * List IoT alert types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotAlertTypeInner get(String iotAlertTypeName); - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String iotAlertTypeName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.java deleted file mode 100644 index add204e53a99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.ManagementState; - -/** An instance of this class provides access to all the operations defined in IotAlertsClient. */ -public interface IotAlertsClient { - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotAlertModelInner get(String scope, String iotAlertId); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String iotAlertId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java deleted file mode 100644 index 2fc29dca0093..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import java.io.InputStream; - -/** An instance of this class provides access to all the operations defined in IotDefenderSettingsClient. */ -public interface IotDefenderSettingsClient { - /** - * List IoT Defender Settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotDefenderSettingsListInner list(); - - /** - * List IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get IoT Defender Settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotDefenderSettingsModelInner get(); - - /** - * Get IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotDefenderSettingsModelInner createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context); - - /** - * Delete IoT Defender settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(); - - /** - * Delete IoT Defender settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(Context context); - - /** - * Information about downloadable packages. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PackageDownloadsInner packageDownloads(); - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response packageDownloadsWithResponse(Context context); - - /** - * Download manager activation data defined for this subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadManagerActivation(); - - /** - * Download manager activation data defined for this subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadManagerActivationWithResponse(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.java deleted file mode 100644 index 73ef2991f597..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; - -/** An instance of this class provides access to all the operations defined in IotRecommendationTypesClient. */ -public interface IotRecommendationTypesClient { - /** - * List IoT recommendation types. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotRecommendationTypeListInner list(); - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotRecommendationTypeInner get(String iotRecommendationTypeName); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String iotRecommendationTypeName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java deleted file mode 100644 index 8d800d83f319..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; - -/** An instance of this class provides access to all the operations defined in IotRecommendationsClient. */ -public interface IotRecommendationsClient { - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotRecommendationModelInner get(String scope, String iotRecommendationId); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String iotRecommendationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java deleted file mode 100644 index 6ea5cb5022dc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import java.io.InputStream; - -/** An instance of this class provides access to all the operations defined in IotSensorsClient. */ -public interface IotSensorsClient { - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSensorsListInner list(String scope); - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scope, Context context); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSensorsModelInner get(String scope, String iotSensorName); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String iotSensorName, Context context); - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSensorsModelInner createOrUpdate(String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel); - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel, Context context); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String iotSensorName); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadActivation(String scope, String iotSensorName); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void triggerTiPackageUpdate(String scope, String iotSensorName); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.java deleted file mode 100644 index 4945f8bc0f1d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; - -/** An instance of this class provides access to all the operations defined in IotSitesClient. */ -public interface IotSitesClient { - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSitesListInner list(String scope); - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scope, Context context); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSitesModelInner get(String scope); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, Context context); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSitesModelInner createOrUpdate(String scope, IotSitesModelInner iotSitesModel); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, IotSitesModelInner iotSitesModel, Context context); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java deleted file mode 100644 index 726cda7fbdbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import java.io.InputStream; - -/** An instance of this class provides access to all the operations defined in OnPremiseIotSensorsClient. */ -public interface OnPremiseIotSensorsClient { - /** - * List on-premise IoT sensors. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OnPremiseIotSensorsListInner list(); - - /** - * List on-premise IoT sensors. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OnPremiseIotSensorInner get(String onPremiseIotSensorName); - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OnPremiseIotSensorInner createOrUpdate(String onPremiseIotSensorName); - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String onPremiseIotSensorName); - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadActivation(String onPremiseIotSensorName); - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java index 329a3db4ed77..6764dd2708f2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java index ed8d21449d3a..929214b439fb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java @@ -37,6 +37,13 @@ public interface SecurityCenter { */ Duration getDefaultPollInterval(); + /** + * Gets the CustomAssessmentAutomationsClient object to access its operations. + * + * @return the CustomAssessmentAutomationsClient object. + */ + CustomAssessmentAutomationsClient getCustomAssessmentAutomations(); + /** * Gets the ComplianceResultsClient object to access its operations. * @@ -324,83 +331,6 @@ public interface SecurityCenter { */ SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); - /** - * Gets the IotDefenderSettingsClient object to access its operations. - * - * @return the IotDefenderSettingsClient object. - */ - IotDefenderSettingsClient getIotDefenderSettings(); - - /** - * Gets the IotSensorsClient object to access its operations. - * - * @return the IotSensorsClient object. - */ - IotSensorsClient getIotSensors(); - - /** - * Gets the DevicesForSubscriptionsClient object to access its operations. - * - * @return the DevicesForSubscriptionsClient object. - */ - DevicesForSubscriptionsClient getDevicesForSubscriptions(); - - /** - * Gets the DevicesForHubsClient object to access its operations. - * - * @return the DevicesForHubsClient object. - */ - DevicesForHubsClient getDevicesForHubs(); - - /** - * Gets the DevicesClient object to access its operations. - * - * @return the DevicesClient object. - */ - DevicesClient getDevices(); - - /** - * Gets the OnPremiseIotSensorsClient object to access its operations. - * - * @return the OnPremiseIotSensorsClient object. - */ - OnPremiseIotSensorsClient getOnPremiseIotSensors(); - - /** - * Gets the IotSitesClient object to access its operations. - * - * @return the IotSitesClient object. - */ - IotSitesClient getIotSites(); - - /** - * Gets the IotAlertsClient object to access its operations. - * - * @return the IotAlertsClient object. - */ - IotAlertsClient getIotAlerts(); - - /** - * Gets the IotAlertTypesClient object to access its operations. - * - * @return the IotAlertTypesClient object. - */ - IotAlertTypesClient getIotAlertTypes(); - - /** - * Gets the IotRecommendationsClient object to access its operations. - * - * @return the IotRecommendationsClient object. - */ - IotRecommendationsClient getIotRecommendations(); - - /** - * Gets the IotRecommendationTypesClient object to access its operations. - * - * @return the IotRecommendationTypesClient object. - */ - IotRecommendationTypesClient getIotRecommendationTypes(); - /** * Gets the AlertsClient object to access its operations. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java index ad7e64021e14..21a9bb42db86 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.security.models.Intent; import com.azure.resourcemanager.security.models.ResourceIdentifier; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -168,6 +169,7 @@ public class AlertInner extends ProxyResource { * Custom properties for the alert. */ @JsonProperty(value = "properties.extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map extendedProperties; /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java new file mode 100644 index 000000000000..d4d9d92d86e7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom Assessment Automation. */ +@JsonFlatten +@Fluent +public class CustomAssessmentAutomationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationInner.class); + + /* + * GZip encoded KQL query representing the assessment automation results + * required. + */ + @JsonProperty(value = "properties.compressedQuery") + private String compressedQuery; + + /* + * Relevant cloud for the custom assessment automation. + */ + @JsonProperty(value = "properties.supportedCloud") + private SupportedCloudEnum supportedCloud; + + /* + * The severity to relate to the assessments generated by this assessment + * automation. + */ + @JsonProperty(value = "properties.severity") + private SeverityEnum severity; + + /* + * The description to relate to the assessments generated by this + * assessment automation. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The remediation description to relate to the assessments generated by + * this assessment automation. + */ + @JsonProperty(value = "properties.remediationDescription") + private String remediationDescription; + + /** + * 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 CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner 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 CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner 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 CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withSeverity(SeverityEnum severity) { + this.severity = severity; + 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 CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner 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 CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withRemediationDescription(String remediationDescription) { + this.remediationDescription = remediationDescription; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceInner.java deleted file mode 100644 index 7c2676265df7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceInner.java +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AuthorizationState; -import com.azure.resourcemanager.security.models.DeviceCriticality; -import com.azure.resourcemanager.security.models.DeviceStatus; -import com.azure.resourcemanager.security.models.Firmware; -import com.azure.resourcemanager.security.models.ManagementState; -import com.azure.resourcemanager.security.models.NetworkInterface; -import com.azure.resourcemanager.security.models.ProgrammingState; -import com.azure.resourcemanager.security.models.Protocol; -import com.azure.resourcemanager.security.models.PurdueLevel; -import com.azure.resourcemanager.security.models.ScanningFunctionality; -import com.azure.resourcemanager.security.models.Sensor; -import com.azure.resourcemanager.security.models.Site; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Device model. */ -@JsonFlatten -@Fluent -public class DeviceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceInner.class); - - /* - * Device display name given by the collector - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Device type. - */ - @JsonProperty(value = "properties.deviceType") - private String deviceType; - - /* - * The source that created the device - */ - @JsonProperty(value = "properties.sourceName", access = JsonProperty.Access.WRITE_ONLY) - private String sourceName; - - /* - * List of network interfaces. - */ - @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) - private List networkInterfaces; - - /* - * Device vendor - */ - @JsonProperty(value = "properties.vendor", access = JsonProperty.Access.WRITE_ONLY) - private String vendor; - - /* - * Device operating system name. - */ - @JsonProperty(value = "properties.osName") - private String osName; - - /* - * List of protocols. - */ - @JsonProperty(value = "properties.protocols", access = JsonProperty.Access.WRITE_ONLY) - private List protocols; - - /* - * last time the device was active in the network - */ - @JsonProperty(value = "properties.lastActiveTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastActiveTime; - - /* - * last time the device was updated - */ - @JsonProperty(value = "properties.lastUpdateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdateTime; - - /* - * Managed state of the device. - */ - @JsonProperty(value = "properties.managementState", access = JsonProperty.Access.WRITE_ONLY) - private ManagementState managementState; - - /* - * Authorized state of the device. - */ - @JsonProperty(value = "properties.authorizationState") - private AuthorizationState authorizationState; - - /* - * Device criticality. - */ - @JsonProperty(value = "properties.deviceCriticality") - private DeviceCriticality deviceCriticality; - - /* - * Purdue level of the device. - */ - @JsonProperty(value = "properties.purdueLevel") - private PurdueLevel purdueLevel; - - /* - * user notes for the device, up to 300 characters. - */ - @JsonProperty(value = "properties.notes") - private String notes; - - /* - * List of device firmwares. - */ - @JsonProperty(value = "properties.firmwares", access = JsonProperty.Access.WRITE_ONLY) - private List firmwares; - - /* - * Discovered time of the device. - */ - @JsonProperty(value = "properties.discoveryTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime discoveryTime; - - /* - * Indicates whether this device is programming - */ - @JsonProperty(value = "properties.programmingState", access = JsonProperty.Access.WRITE_ONLY) - private ProgrammingState programmingState; - - /* - * last time the device was programming or programed. - */ - @JsonProperty(value = "properties.lastProgrammingTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastProgrammingTime; - - /* - * Indicates whether the device is a scanner - */ - @JsonProperty(value = "properties.scanningFunctionality", access = JsonProperty.Access.WRITE_ONLY) - private ScanningFunctionality scanningFunctionality; - - /* - * last time the device was scanning. - */ - @JsonProperty(value = "properties.lastScanTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastScanTime; - - /* - * risk score of the device. - */ - @JsonProperty(value = "properties.riskScore", access = JsonProperty.Access.WRITE_ONLY) - private Integer riskScore; - - /* - * List of sensors that scanned this device. - */ - @JsonProperty(value = "properties.sensors", access = JsonProperty.Access.WRITE_ONLY) - private List sensors; - - /* - * Site data - */ - @JsonProperty(value = "properties.site", access = JsonProperty.Access.WRITE_ONLY) - private Site site; - - /* - * Device status. - */ - @JsonProperty(value = "properties.deviceStatus", access = JsonProperty.Access.WRITE_ONLY) - private DeviceStatus deviceStatus; - - /** - * Get the displayName property: Device display name given by the collector. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Device display name given by the collector. - * - * @param displayName the displayName value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the deviceType property: Device type. - * - * @return the deviceType value. - */ - public String deviceType() { - return this.deviceType; - } - - /** - * Set the deviceType property: Device type. - * - * @param deviceType the deviceType value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withDeviceType(String deviceType) { - this.deviceType = deviceType; - return this; - } - - /** - * Get the sourceName property: The source that created the device. - * - * @return the sourceName value. - */ - public String sourceName() { - return this.sourceName; - } - - /** - * Get the networkInterfaces property: List of network interfaces. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Get the vendor property: Device vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Get the osName property: Device operating system name. - * - * @return the osName value. - */ - public String osName() { - return this.osName; - } - - /** - * Set the osName property: Device operating system name. - * - * @param osName the osName value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withOsName(String osName) { - this.osName = osName; - return this; - } - - /** - * Get the protocols property: List of protocols. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Get the lastActiveTime property: last time the device was active in the network. - * - * @return the lastActiveTime value. - */ - public OffsetDateTime lastActiveTime() { - return this.lastActiveTime; - } - - /** - * Get the lastUpdateTime property: last time the device was updated. - * - * @return the lastUpdateTime value. - */ - public OffsetDateTime lastUpdateTime() { - return this.lastUpdateTime; - } - - /** - * Get the managementState property: Managed state of the device. - * - * @return the managementState value. - */ - public ManagementState managementState() { - return this.managementState; - } - - /** - * Get the authorizationState property: Authorized state of the device. - * - * @return the authorizationState value. - */ - public AuthorizationState authorizationState() { - return this.authorizationState; - } - - /** - * Set the authorizationState property: Authorized state of the device. - * - * @param authorizationState the authorizationState value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withAuthorizationState(AuthorizationState authorizationState) { - this.authorizationState = authorizationState; - return this; - } - - /** - * Get the deviceCriticality property: Device criticality. - * - * @return the deviceCriticality value. - */ - public DeviceCriticality deviceCriticality() { - return this.deviceCriticality; - } - - /** - * Set the deviceCriticality property: Device criticality. - * - * @param deviceCriticality the deviceCriticality value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withDeviceCriticality(DeviceCriticality deviceCriticality) { - this.deviceCriticality = deviceCriticality; - return this; - } - - /** - * Get the purdueLevel property: Purdue level of the device. - * - * @return the purdueLevel value. - */ - public PurdueLevel purdueLevel() { - return this.purdueLevel; - } - - /** - * Set the purdueLevel property: Purdue level of the device. - * - * @param purdueLevel the purdueLevel value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withPurdueLevel(PurdueLevel purdueLevel) { - this.purdueLevel = purdueLevel; - return this; - } - - /** - * Get the notes property: user notes for the device, up to 300 characters. - * - * @return the notes value. - */ - public String notes() { - return this.notes; - } - - /** - * Set the notes property: user notes for the device, up to 300 characters. - * - * @param notes the notes value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withNotes(String notes) { - this.notes = notes; - return this; - } - - /** - * Get the firmwares property: List of device firmwares. - * - * @return the firmwares value. - */ - public List firmwares() { - return this.firmwares; - } - - /** - * Get the discoveryTime property: Discovered time of the device. - * - * @return the discoveryTime value. - */ - public OffsetDateTime discoveryTime() { - return this.discoveryTime; - } - - /** - * Get the programmingState property: Indicates whether this device is programming. - * - * @return the programmingState value. - */ - public ProgrammingState programmingState() { - return this.programmingState; - } - - /** - * Get the lastProgrammingTime property: last time the device was programming or programed. - * - * @return the lastProgrammingTime value. - */ - public OffsetDateTime lastProgrammingTime() { - return this.lastProgrammingTime; - } - - /** - * Get the scanningFunctionality property: Indicates whether the device is a scanner. - * - * @return the scanningFunctionality value. - */ - public ScanningFunctionality scanningFunctionality() { - return this.scanningFunctionality; - } - - /** - * Get the lastScanTime property: last time the device was scanning. - * - * @return the lastScanTime value. - */ - public OffsetDateTime lastScanTime() { - return this.lastScanTime; - } - - /** - * Get the riskScore property: risk score of the device. - * - * @return the riskScore value. - */ - public Integer riskScore() { - return this.riskScore; - } - - /** - * Get the sensors property: List of sensors that scanned this device. - * - * @return the sensors value. - */ - public List sensors() { - return this.sensors; - } - - /** - * Get the site property: Site data. - * - * @return the site value. - */ - public Site site() { - return this.site; - } - - /** - * Get the deviceStatus property: Device status. - * - * @return the deviceStatus value. - */ - public DeviceStatus deviceStatus() { - return this.deviceStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - if (protocols() != null) { - protocols().forEach(e -> e.validate()); - } - if (firmwares() != null) { - firmwares().forEach(e -> e.validate()); - } - if (sensors() != null) { - sensors().forEach(e -> e.validate()); - } - if (site() != null) { - site().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java index 58ffc98ba14f..bbe9867c2875 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.security.models.InformationType; import com.azure.resourcemanager.security.models.SensitivityLabel; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; @@ -37,12 +38,14 @@ public class InformationProtectionPolicyInner extends ProxyResource { * Dictionary of sensitivity labels. */ @JsonProperty(value = "properties.labels") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map labels; /* * The sensitivity information types. */ @JsonProperty(value = "properties.informationTypes") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map informationTypes; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java index e63895b8af85..8255a4e1658f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; import com.azure.resourcemanager.security.models.ReportedSeverity; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.LocalDate; import java.util.List; @@ -105,6 +106,7 @@ public class IoTSecurityAggregatedAlertInner extends ProxyResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java index c75f4c6ded38..5e0b6d7b3388 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java @@ -10,6 +10,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ReportedSeverity; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -83,6 +84,7 @@ public class IoTSecurityAggregatedRecommendationInner extends ProxyResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java index b4fba2e83a4b..35f4bc16dab7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -112,6 +113,7 @@ public class IoTSecuritySolutionModelInner extends ProxyResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java deleted file mode 100644 index f6fe3964e991..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IoT alert. */ -@JsonFlatten -@Fluent -public class IotAlertModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertModelInner.class); - - /* - * Holds the product canonical identifier of the alert within the scope of - * a product - */ - @JsonProperty(value = "properties.systemAlertId", access = JsonProperty.Access.WRITE_ONLY) - private String systemAlertId; - - /* - * Display name of the main entity being reported on - */ - @JsonProperty(value = "properties.compromisedEntity", access = JsonProperty.Access.WRITE_ONLY) - private String compromisedEntity; - - /* - * The type name of the alert - */ - @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) - private String alertType; - - /* - * The impact start time of the alert (the time of the first event or - * activity included in the alert) - */ - @JsonProperty(value = "properties.startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private String startTimeUtc; - - /* - * The impact end time of the alert (the time of the last event or activity - * included in the alert) - */ - @JsonProperty(value = "properties.endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private String endTimeUtc; - - /* - * A list of entities related to the alert - */ - @JsonProperty(value = "properties.entities") - private List entities; - - /* - * A bag of fields which extends the alert information - */ - @JsonProperty(value = "properties.extendedProperties") - private Object extendedProperties; - - /** - * Get the systemAlertId property: Holds the product canonical identifier of the alert within the scope of a - * product. - * - * @return the systemAlertId value. - */ - public String systemAlertId() { - return this.systemAlertId; - } - - /** - * Get the compromisedEntity property: Display name of the main entity being reported on. - * - * @return the compromisedEntity value. - */ - public String compromisedEntity() { - return this.compromisedEntity; - } - - /** - * Get the alertType property: The type name of the alert. - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Get the startTimeUtc property: The impact start time of the alert (the time of the first event or activity - * included in the alert). - * - * @return the startTimeUtc value. - */ - public String startTimeUtc() { - return this.startTimeUtc; - } - - /** - * Get the endTimeUtc property: The impact end time of the alert (the time of the last event or activity included in - * the alert). - * - * @return the endTimeUtc value. - */ - public String endTimeUtc() { - return this.endTimeUtc; - } - - /** - * Get the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - public List entities() { - return this.entities; - } - - /** - * Set the entities property: A list of entities related to the alert. - * - * @param entities the entities value to set. - * @return the IotAlertModelInner object itself. - */ - public IotAlertModelInner withEntities(List entities) { - this.entities = entities; - return this; - } - - /** - * Get the extendedProperties property: A bag of fields which extends the alert information. - * - * @return the extendedProperties value. - */ - public Object extendedProperties() { - return this.extendedProperties; - } - - /** - * Set the extendedProperties property: A bag of fields which extends the alert information. - * - * @param extendedProperties the extendedProperties value to set. - * @return the IotAlertModelInner object itself. - */ - public IotAlertModelInner withExtendedProperties(Object extendedProperties) { - this.extendedProperties = extendedProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeInner.java deleted file mode 100644 index 180a9cf7a0bb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeInner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AlertIntent; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IoT alert type. */ -@JsonFlatten -@Immutable -public class IotAlertTypeInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertTypeInner.class); - - /* - * The display name of the alert - */ - @JsonProperty(value = "properties.alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * The severity of the alert - */ - @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) - private AlertSeverity severity; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The name of the alert provider or internal partner - */ - @JsonProperty(value = "properties.providerName", access = JsonProperty.Access.WRITE_ONLY) - private String providerName; - - /* - * The name of the product which published this alert - */ - @JsonProperty(value = "properties.productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The name of a component inside the product which generated the alert - */ - @JsonProperty(value = "properties.productComponentName", access = JsonProperty.Access.WRITE_ONLY) - private String productComponentName; - - /* - * The name of the vendor that raise the alert - */ - @JsonProperty(value = "properties.vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * Kill chain related intent behind the alert. Could contain multiple enum - * values (separated by commas) - */ - @JsonProperty(value = "properties.intent", access = JsonProperty.Access.WRITE_ONLY) - private AlertIntent intent; - - /* - * Manual action items to take to remediate the alert - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private List remediationSteps; - - /** - * Get the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the severity property: The severity of the alert. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.severity; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the providerName property: The name of the alert provider or internal partner. - * - * @return the providerName value. - */ - public String providerName() { - return this.providerName; - } - - /** - * Get the productName property: The name of the product which published this alert. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the productComponentName property: The name of a component inside the product which generated the alert. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.productComponentName; - } - - /** - * Get the vendorName property: The name of the vendor that raise the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the intent property: Kill chain related intent behind the alert. Could contain multiple enum values - * (separated by commas). - * - * @return the intent value. - */ - public AlertIntent intent() { - return this.intent; - } - - /** - * Get the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.remediationSteps; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeListInner.java deleted file mode 100644 index d428d8283f9a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeListInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of alert types. */ -@Fluent -public final class IotAlertTypeListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertTypeListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List data. - * - * @param value the value value to set. - * @return the IotAlertTypeListInner object itself. - */ - public IotAlertTypeListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsListInner.java deleted file mode 100644 index 26fb0a90bee1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsListInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT Defender settings. */ -@Immutable -public final class IotDefenderSettingsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDefenderSettingsListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsModelInner.java deleted file mode 100644 index 0619dc3c8394..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsModelInner.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.OnboardingKind; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** IoT Defender settings. */ -@JsonFlatten -@Fluent -public class IotDefenderSettingsModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDefenderSettingsModelInner.class); - - /* - * Size of the device quota (as a opposed to a Pay as You Go billing - * model). Value is required to be in multiples of 1000. - */ - @JsonProperty(value = "properties.deviceQuota") - private Integer deviceQuota; - - /* - * Sentinel Workspace Resource Ids - */ - @JsonProperty(value = "properties.sentinelWorkspaceResourceIds") - private List sentinelWorkspaceResourceIds; - - /* - * The kind of onboarding for the subscription - */ - @JsonProperty(value = "properties.onboardingKind") - private OnboardingKind onboardingKind; - - /* - * End time of the evaluation period, if such exist - */ - @JsonProperty(value = "properties.evaluationEndTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime evaluationEndTime; - - /** - * Get the deviceQuota property: Size of the device quota (as a opposed to a Pay as You Go billing model). Value is - * required to be in multiples of 1000. - * - * @return the deviceQuota value. - */ - public Integer deviceQuota() { - return this.deviceQuota; - } - - /** - * Set the deviceQuota property: Size of the device quota (as a opposed to a Pay as You Go billing model). Value is - * required to be in multiples of 1000. - * - * @param deviceQuota the deviceQuota value to set. - * @return the IotDefenderSettingsModelInner object itself. - */ - public IotDefenderSettingsModelInner withDeviceQuota(Integer deviceQuota) { - this.deviceQuota = deviceQuota; - return this; - } - - /** - * Get the sentinelWorkspaceResourceIds property: Sentinel Workspace Resource Ids. - * - * @return the sentinelWorkspaceResourceIds value. - */ - public List sentinelWorkspaceResourceIds() { - return this.sentinelWorkspaceResourceIds; - } - - /** - * Set the sentinelWorkspaceResourceIds property: Sentinel Workspace Resource Ids. - * - * @param sentinelWorkspaceResourceIds the sentinelWorkspaceResourceIds value to set. - * @return the IotDefenderSettingsModelInner object itself. - */ - public IotDefenderSettingsModelInner withSentinelWorkspaceResourceIds(List sentinelWorkspaceResourceIds) { - this.sentinelWorkspaceResourceIds = sentinelWorkspaceResourceIds; - return this; - } - - /** - * Get the onboardingKind property: The kind of onboarding for the subscription. - * - * @return the onboardingKind value. - */ - public OnboardingKind onboardingKind() { - return this.onboardingKind; - } - - /** - * Set the onboardingKind property: The kind of onboarding for the subscription. - * - * @param onboardingKind the onboardingKind value to set. - * @return the IotDefenderSettingsModelInner object itself. - */ - public IotDefenderSettingsModelInner withOnboardingKind(OnboardingKind onboardingKind) { - this.onboardingKind = onboardingKind; - return this; - } - - /** - * Get the evaluationEndTime property: End time of the evaluation period, if such exist. - * - * @return the evaluationEndTime value. - */ - public OffsetDateTime evaluationEndTime() { - return this.evaluationEndTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationModelInner.java deleted file mode 100644 index b094b7940c0c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationModelInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IoT recommendation. */ -@JsonFlatten -@Fluent -public class IotRecommendationModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationModelInner.class); - - /* - * Identifier of the device being reported on - */ - @JsonProperty(value = "properties.deviceId", access = JsonProperty.Access.WRITE_ONLY) - private String deviceId; - - /* - * The type name of the recommendation - */ - @JsonProperty(value = "properties.recommendationType", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationType; - - /* - * The discovery time of the recommendation - */ - @JsonProperty(value = "properties.discoveredTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private String discoveredTimeUtc; - - /* - * A bag of fields which extends the recommendation information - */ - @JsonProperty(value = "properties.recommendationAdditionalData") - private Object recommendationAdditionalData; - - /** - * Get the deviceId property: Identifier of the device being reported on. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.deviceId; - } - - /** - * Get the recommendationType property: The type name of the recommendation. - * - * @return the recommendationType value. - */ - public String recommendationType() { - return this.recommendationType; - } - - /** - * Get the discoveredTimeUtc property: The discovery time of the recommendation. - * - * @return the discoveredTimeUtc value. - */ - public String discoveredTimeUtc() { - return this.discoveredTimeUtc; - } - - /** - * Get the recommendationAdditionalData property: A bag of fields which extends the recommendation information. - * - * @return the recommendationAdditionalData value. - */ - public Object recommendationAdditionalData() { - return this.recommendationAdditionalData; - } - - /** - * Set the recommendationAdditionalData property: A bag of fields which extends the recommendation information. - * - * @param recommendationAdditionalData the recommendationAdditionalData value to set. - * @return the IotRecommendationModelInner object itself. - */ - public IotRecommendationModelInner withRecommendationAdditionalData(Object recommendationAdditionalData) { - this.recommendationAdditionalData = recommendationAdditionalData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeInner.java deleted file mode 100644 index eaca53fa1320..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.RecommendationSeverity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IoT recommendation type. */ -@JsonFlatten -@Immutable -public class IotRecommendationTypeInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationTypeInner.class); - - /* - * The display name of the recommendation - */ - @JsonProperty(value = "properties.recommendationDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationDisplayName; - - /* - * The severity of the recommendation - */ - @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) - private RecommendationSeverity severity; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The name of the product which published this recommendation - */ - @JsonProperty(value = "properties.productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The name of a component inside the product which generated the - * recommendation - */ - @JsonProperty(value = "properties.productComponentName", access = JsonProperty.Access.WRITE_ONLY) - private String productComponentName; - - /* - * The name of the vendor that raised the recommendation - */ - @JsonProperty(value = "properties.vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * The name of the recommendation's control category - */ - @JsonProperty(value = "properties.control", access = JsonProperty.Access.WRITE_ONLY) - private String control; - - /* - * Manual action items to take to resolve the recommendation - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private List remediationSteps; - - /* - * The alert's data source - */ - @JsonProperty(value = "properties.dataSource", access = JsonProperty.Access.WRITE_ONLY) - private String dataSource; - - /** - * Get the recommendationDisplayName property: The display name of the recommendation. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.recommendationDisplayName; - } - - /** - * Get the severity property: The severity of the recommendation. - * - * @return the severity value. - */ - public RecommendationSeverity severity() { - return this.severity; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the productName property: The name of the product which published this recommendation. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the productComponentName property: The name of a component inside the product which generated the - * recommendation. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.productComponentName; - } - - /** - * Get the vendorName property: The name of the vendor that raised the recommendation. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the control property: The name of the recommendation's control category. - * - * @return the control value. - */ - public String control() { - return this.control; - } - - /** - * Get the remediationSteps property: Manual action items to take to resolve the recommendation. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the dataSource property: The alert's data source. - * - * @return the dataSource value. - */ - public String dataSource() { - return this.dataSource; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeListInner.java deleted file mode 100644 index 72028c184a28..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeListInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of recommendation types. */ -@Fluent -public final class IotRecommendationTypeListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationTypeListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List data. - * - * @param value the value value to set. - * @return the IotRecommendationTypeListInner object itself. - */ - public IotRecommendationTypeListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsListInner.java deleted file mode 100644 index 94c2c0fe00ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsListInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT sensors. */ -@Immutable -public final class IotSensorsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSensorsListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsModelInner.java deleted file mode 100644 index b29eeacb9c94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsModelInner.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.SensorStatus; -import com.azure.resourcemanager.security.models.SensorType; -import com.azure.resourcemanager.security.models.TiStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IoT sensor model. */ -@JsonFlatten -@Fluent -public class IotSensorsModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSensorsModelInner.class); - - /* - * Last connectivity time of the IoT sensor - */ - @JsonProperty(value = "properties.connectivityTime", access = JsonProperty.Access.WRITE_ONLY) - private String connectivityTime; - - /* - * Creation time of the IoT sensor - */ - @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) - private String creationTime; - - /* - * Dynamic mode status of the IoT sensor - */ - @JsonProperty(value = "properties.dynamicLearning", access = JsonProperty.Access.WRITE_ONLY) - private Boolean dynamicLearning; - - /* - * Learning mode status of the IoT sensor - */ - @JsonProperty(value = "properties.learningMode", access = JsonProperty.Access.WRITE_ONLY) - private Boolean learningMode; - - /* - * Status of the IoT sensor - */ - @JsonProperty(value = "properties.sensorStatus", access = JsonProperty.Access.WRITE_ONLY) - private SensorStatus sensorStatus; - - /* - * Version of the IoT sensor - */ - @JsonProperty(value = "properties.sensorVersion", access = JsonProperty.Access.WRITE_ONLY) - private String sensorVersion; - - /* - * TI Automatic mode status of the IoT sensor - */ - @JsonProperty(value = "properties.tiAutomaticUpdates") - private Boolean tiAutomaticUpdates; - - /* - * TI Status of the IoT sensor - */ - @JsonProperty(value = "properties.tiStatus", access = JsonProperty.Access.WRITE_ONLY) - private TiStatus tiStatus; - - /* - * TI Version of the IoT sensor - */ - @JsonProperty(value = "properties.tiVersion", access = JsonProperty.Access.WRITE_ONLY) - private String tiVersion; - - /* - * Zone of the IoT sensor - */ - @JsonProperty(value = "properties.zone") - private String zone; - - /* - * Type of sensor - */ - @JsonProperty(value = "properties.sensorType") - private SensorType sensorType; - - /** - * Get the connectivityTime property: Last connectivity time of the IoT sensor. - * - * @return the connectivityTime value. - */ - public String connectivityTime() { - return this.connectivityTime; - } - - /** - * Get the creationTime property: Creation time of the IoT sensor. - * - * @return the creationTime value. - */ - public String creationTime() { - return this.creationTime; - } - - /** - * Get the dynamicLearning property: Dynamic mode status of the IoT sensor. - * - * @return the dynamicLearning value. - */ - public Boolean dynamicLearning() { - return this.dynamicLearning; - } - - /** - * Get the learningMode property: Learning mode status of the IoT sensor. - * - * @return the learningMode value. - */ - public Boolean learningMode() { - return this.learningMode; - } - - /** - * Get the sensorStatus property: Status of the IoT sensor. - * - * @return the sensorStatus value. - */ - public SensorStatus sensorStatus() { - return this.sensorStatus; - } - - /** - * Get the sensorVersion property: Version of the IoT sensor. - * - * @return the sensorVersion value. - */ - public String sensorVersion() { - return this.sensorVersion; - } - - /** - * Get the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @return the tiAutomaticUpdates value. - */ - public Boolean tiAutomaticUpdates() { - return this.tiAutomaticUpdates; - } - - /** - * Set the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @param tiAutomaticUpdates the tiAutomaticUpdates value to set. - * @return the IotSensorsModelInner object itself. - */ - public IotSensorsModelInner withTiAutomaticUpdates(Boolean tiAutomaticUpdates) { - this.tiAutomaticUpdates = tiAutomaticUpdates; - return this; - } - - /** - * Get the tiStatus property: TI Status of the IoT sensor. - * - * @return the tiStatus value. - */ - public TiStatus tiStatus() { - return this.tiStatus; - } - - /** - * Get the tiVersion property: TI Version of the IoT sensor. - * - * @return the tiVersion value. - */ - public String tiVersion() { - return this.tiVersion; - } - - /** - * Get the zone property: Zone of the IoT sensor. - * - * @return the zone value. - */ - public String zone() { - return this.zone; - } - - /** - * Set the zone property: Zone of the IoT sensor. - * - * @param zone the zone value to set. - * @return the IotSensorsModelInner object itself. - */ - public IotSensorsModelInner withZone(String zone) { - this.zone = zone; - return this; - } - - /** - * Get the sensorType property: Type of sensor. - * - * @return the sensorType value. - */ - public SensorType sensorType() { - return this.sensorType; - } - - /** - * Set the sensorType property: Type of sensor. - * - * @param sensorType the sensorType value to set. - * @return the IotSensorsModelInner object itself. - */ - public IotSensorsModelInner withSensorType(SensorType sensorType) { - this.sensorType = sensorType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesListInner.java deleted file mode 100644 index d2a293720595..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesListInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT sites. */ -@Immutable -public final class IotSitesListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSitesListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesModelInner.java deleted file mode 100644 index d9b9d727f3d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesModelInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** IoT site model. */ -@JsonFlatten -@Fluent -public class IotSitesModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSitesModelInner.class); - - /* - * Display name of the IoT site - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Tags of the IoT site - */ - @JsonProperty(value = "properties.tags") - private Map tags; - - /** - * Get the displayName property: Display name of the IoT site. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the IoT site. - * - * @param displayName the displayName value to set. - * @return the IotSitesModelInner object itself. - */ - public IotSitesModelInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the tags property: Tags of the IoT site. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Tags of the IoT site. - * - * @param tags the tags value to set. - * @return the IotSitesModelInner object itself. - */ - public IotSitesModelInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorInner.java deleted file mode 100644 index fd611d7dcc16..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** On-premise IoT sensor. */ -@Fluent -public final class OnPremiseIotSensorInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorInner.class); - - /* - * On-premise IoT sensor properties - */ - @JsonProperty(value = "properties") - private Object properties; - - /** - * Get the properties property: On-premise IoT sensor properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: On-premise IoT sensor properties. - * - * @param properties the properties value to set. - * @return the OnPremiseIotSensorInner object itself. - */ - public OnPremiseIotSensorInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorsListInner.java deleted file mode 100644 index a1b2eae47e53..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorsListInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of on-premise IoT sensors. */ -@Immutable -public final class OnPremiseIotSensorsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorsListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PackageDownloadsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PackageDownloadsInner.java deleted file mode 100644 index 63aa43ea9fd5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PackageDownloadsInner.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.PackageDownloadInfo; -import com.azure.resourcemanager.security.models.PackageDownloadsCentralManager; -import com.azure.resourcemanager.security.models.PackageDownloadsSensor; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about package downloads. */ -@Immutable -public final class PackageDownloadsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsInner.class); - - /* - * Contains all Sensor binary downloads - */ - @JsonProperty(value = "sensor", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsSensor sensor; - - /* - * All downloads for Central Manager - */ - @JsonProperty(value = "centralManager", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsCentralManager centralManager; - - /* - * All downloads for threat intelligence - */ - @JsonProperty(value = "threatIntelligence", access = JsonProperty.Access.WRITE_ONLY) - private List threatIntelligence; - - /* - * SNMP Server file - */ - @JsonProperty(value = "snmp", access = JsonProperty.Access.WRITE_ONLY) - private List snmp; - - /* - * Used for local configuration export - */ - @JsonProperty(value = "wmiTool", access = JsonProperty.Access.WRITE_ONLY) - private List wmiTool; - - /* - * Authorized devices import template - */ - @JsonProperty(value = "authorizedDevicesImportTemplate", access = JsonProperty.Access.WRITE_ONLY) - private List authorizedDevicesImportTemplate; - - /* - * Authorized devices import template - */ - @JsonProperty(value = "deviceInformationUpdateImportTemplate", access = JsonProperty.Access.WRITE_ONLY) - private List deviceInformationUpdateImportTemplate; - - /** - * Get the sensor property: Contains all Sensor binary downloads. - * - * @return the sensor value. - */ - public PackageDownloadsSensor sensor() { - return this.sensor; - } - - /** - * Get the centralManager property: All downloads for Central Manager. - * - * @return the centralManager value. - */ - public PackageDownloadsCentralManager centralManager() { - return this.centralManager; - } - - /** - * Get the threatIntelligence property: All downloads for threat intelligence. - * - * @return the threatIntelligence value. - */ - public List threatIntelligence() { - return this.threatIntelligence; - } - - /** - * Get the snmp property: SNMP Server file. - * - * @return the snmp value. - */ - public List snmp() { - return this.snmp; - } - - /** - * Get the wmiTool property: Used for local configuration export. - * - * @return the wmiTool value. - */ - public List wmiTool() { - return this.wmiTool; - } - - /** - * Get the authorizedDevicesImportTemplate property: Authorized devices import template. - * - * @return the authorizedDevicesImportTemplate value. - */ - public List authorizedDevicesImportTemplate() { - return this.authorizedDevicesImportTemplate; - } - - /** - * Get the deviceInformationUpdateImportTemplate property: Authorized devices import template. - * - * @return the deviceInformationUpdateImportTemplate value. - */ - public List deviceInformationUpdateImportTemplate() { - return this.deviceInformationUpdateImportTemplate; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sensor() != null) { - sensor().validate(); - } - if (centralManager() != null) { - centralManager().validate(); - } - if (threatIntelligence() != null) { - threatIntelligence().forEach(e -> e.validate()); - } - if (snmp() != null) { - snmp().forEach(e -> e.validate()); - } - if (wmiTool() != null) { - wmiTool().forEach(e -> e.validate()); - } - if (authorizedDevicesImportTemplate() != null) { - authorizedDevicesImportTemplate().forEach(e -> e.validate()); - } - if (deviceInformationUpdateImportTemplate() != null) { - deviceInformationUpdateImportTemplate().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java index 0df3e3eb6906..23e297d6b7af 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java @@ -12,18 +12,21 @@ import com.azure.resourcemanager.security.models.Categories; import com.azure.resourcemanager.security.models.ImplementationEffort; import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Tactics; +import com.azure.resourcemanager.security.models.Techniques; import com.azure.resourcemanager.security.models.Threats; import com.azure.resourcemanager.security.models.UserImpact; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security assessment metadata. */ +/** Security assessment metadata response. */ @JsonFlatten @Fluent -public class SecurityAssessmentMetadataInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataInner.class); +public class SecurityAssessmentMetadataResponseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataResponseInner.class); /* * User friendly display name of the assessment @@ -100,6 +103,30 @@ public class SecurityAssessmentMetadataInner extends ProxyResource { @JsonProperty(value = "properties.partnerData") private SecurityAssessmentMetadataPartnerData partnerData; + /* + * The publishDates property. + */ + @JsonProperty(value = "properties.publishDates") + private SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates; + + /* + * The plannedDeprecationDate property. + */ + @JsonProperty(value = "properties.plannedDeprecationDate") + private String plannedDeprecationDate; + + /* + * The tactics property. + */ + @JsonProperty(value = "properties.tactics") + private List tactics; + + /* + * The techniques property. + */ + @JsonProperty(value = "properties.techniques") + private List techniques; + /** * Get the displayName property: User friendly display name of the assessment. * @@ -113,9 +140,9 @@ public String displayName() { * Set the displayName property: User friendly display name of the assessment. * * @param displayName the displayName value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withDisplayName(String displayName) { + public SecurityAssessmentMetadataResponseInner withDisplayName(String displayName) { this.displayName = displayName; return this; } @@ -143,9 +170,9 @@ public String description() { * Set the description property: Human readable description of the assessment. * * @param description the description value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withDescription(String description) { + public SecurityAssessmentMetadataResponseInner withDescription(String description) { this.description = description; return this; } @@ -165,9 +192,9 @@ public String remediationDescription() { * security issue. * * @param remediationDescription the remediationDescription value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withRemediationDescription(String remediationDescription) { + public SecurityAssessmentMetadataResponseInner withRemediationDescription(String remediationDescription) { this.remediationDescription = remediationDescription; return this; } @@ -185,9 +212,9 @@ public List categories() { * Set the categories property: The categories property. * * @param categories the categories value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withCategories(List categories) { + public SecurityAssessmentMetadataResponseInner withCategories(List categories) { this.categories = categories; return this; } @@ -205,9 +232,9 @@ public Severity severity() { * Set the severity property: The severity level of the assessment. * * @param severity the severity value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withSeverity(Severity severity) { + public SecurityAssessmentMetadataResponseInner withSeverity(Severity severity) { this.severity = severity; return this; } @@ -225,9 +252,9 @@ public UserImpact userImpact() { * Set the userImpact property: The user impact of the assessment. * * @param userImpact the userImpact value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withUserImpact(UserImpact userImpact) { + public SecurityAssessmentMetadataResponseInner withUserImpact(UserImpact userImpact) { this.userImpact = userImpact; return this; } @@ -245,9 +272,9 @@ public ImplementationEffort implementationEffort() { * Set the implementationEffort property: The implementation effort required to remediate this assessment. * * @param implementationEffort the implementationEffort value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withImplementationEffort(ImplementationEffort implementationEffort) { + public SecurityAssessmentMetadataResponseInner withImplementationEffort(ImplementationEffort implementationEffort) { this.implementationEffort = implementationEffort; return this; } @@ -265,9 +292,9 @@ public List threats() { * Set the threats property: The threats property. * * @param threats the threats value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withThreats(List threats) { + public SecurityAssessmentMetadataResponseInner withThreats(List threats) { this.threats = threats; return this; } @@ -285,9 +312,9 @@ public Boolean preview() { * Set the preview property: True if this assessment is in preview release status. * * @param preview the preview value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withPreview(Boolean preview) { + public SecurityAssessmentMetadataResponseInner withPreview(Boolean preview) { this.preview = preview; return this; } @@ -307,9 +334,9 @@ public AssessmentType assessmentType() { * the assessment based on custom Azure Policy definition. * * @param assessmentType the assessmentType value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withAssessmentType(AssessmentType assessmentType) { + public SecurityAssessmentMetadataResponseInner withAssessmentType(AssessmentType assessmentType) { this.assessmentType = assessmentType; return this; } @@ -327,13 +354,94 @@ public SecurityAssessmentMetadataPartnerData partnerData() { * Set the partnerData property: Describes the partner that created the assessment. * * @param partnerData the partnerData value to set. - * @return the SecurityAssessmentMetadataInner object itself. + * @return the SecurityAssessmentMetadataResponseInner object itself. */ - public SecurityAssessmentMetadataInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { + public SecurityAssessmentMetadataResponseInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { this.partnerData = partnerData; return this; } + /** + * Get the publishDates property: The publishDates property. + * + * @return the publishDates value. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { + return this.publishDates; + } + + /** + * Set the publishDates property: The publishDates property. + * + * @param publishDates the publishDates value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withPublishDates( + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + this.publishDates = publishDates; + return this; + } + + /** + * Get the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @return the plannedDeprecationDate value. + */ + public String plannedDeprecationDate() { + return this.plannedDeprecationDate; + } + + /** + * Set the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @param plannedDeprecationDate the plannedDeprecationDate value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withPlannedDeprecationDate(String plannedDeprecationDate) { + this.plannedDeprecationDate = plannedDeprecationDate; + return this; + } + + /** + * Get the tactics property: The tactics property. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics property. + * + * @param tactics the tactics value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the techniques property: The techniques property. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Set the techniques property: The techniques property. + * + * @param techniques the techniques value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withTechniques(List techniques) { + this.techniques = techniques; + return this; + } + /** * Validates the instance. * @@ -343,5 +451,8 @@ public void validate() { if (partnerData() != null) { partnerData().validate(); } + if (publishDates() != null) { + publishDates().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java similarity index 81% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentInner.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java index c053d6cb76b9..30d903108d73 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java @@ -9,19 +9,20 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatus; +import com.azure.resourcemanager.security.models.AssessmentStatusResponse; import com.azure.resourcemanager.security.models.ResourceDetails; import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Security assessment on a resource. */ +/** Security assessment on a resource - response format. */ @JsonFlatten @Fluent -public class SecurityAssessmentInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentInner.class); +public class SecurityAssessmentResponseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentResponseInner.class); /* * Details of the resource that was assessed @@ -35,16 +36,11 @@ public class SecurityAssessmentInner extends ProxyResource { @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) private String displayName; - /* - * The result of the assessment - */ - @JsonProperty(value = "properties.status") - private AssessmentStatus status; - /* * Additional data regarding the assessment */ @JsonProperty(value = "properties.additionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map additionalData; /* @@ -65,6 +61,12 @@ public class SecurityAssessmentInner extends ProxyResource { @JsonProperty(value = "properties.partnersData") private SecurityAssessmentPartnerData partnersData; + /* + * The result of the assessment + */ + @JsonProperty(value = "properties.status") + private AssessmentStatusResponse status; + /** * Get the resourceDetails property: Details of the resource that was assessed. * @@ -78,9 +80,9 @@ public ResourceDetails resourceDetails() { * Set the resourceDetails property: Details of the resource that was assessed. * * @param resourceDetails the resourceDetails value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentResponseInner object itself. */ - public SecurityAssessmentInner withResourceDetails(ResourceDetails resourceDetails) { + public SecurityAssessmentResponseInner withResourceDetails(ResourceDetails resourceDetails) { this.resourceDetails = resourceDetails; return this; } @@ -94,26 +96,6 @@ public String displayName() { return this.displayName; } - /** - * Get the status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatus status() { - return this.status; - } - - /** - * Set the status property: The result of the assessment. - * - * @param status the status value to set. - * @return the SecurityAssessmentInner object itself. - */ - public SecurityAssessmentInner withStatus(AssessmentStatus status) { - this.status = status; - return this; - } - /** * Get the additionalData property: Additional data regarding the assessment. * @@ -127,9 +109,9 @@ public Map additionalData() { * Set the additionalData property: Additional data regarding the assessment. * * @param additionalData the additionalData value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentResponseInner object itself. */ - public SecurityAssessmentInner withAdditionalData(Map additionalData) { + public SecurityAssessmentResponseInner withAdditionalData(Map additionalData) { this.additionalData = additionalData; return this; } @@ -156,9 +138,9 @@ public SecurityAssessmentMetadataProperties metadata() { * Set the metadata property: Describes properties of an assessment metadata. * * @param metadata the metadata value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentResponseInner object itself. */ - public SecurityAssessmentInner withMetadata(SecurityAssessmentMetadataProperties metadata) { + public SecurityAssessmentResponseInner withMetadata(SecurityAssessmentMetadataProperties metadata) { this.metadata = metadata; return this; } @@ -176,13 +158,33 @@ public SecurityAssessmentPartnerData partnersData() { * Set the partnersData property: Data regarding 3rd party partner integration. * * @param partnersData the partnersData value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentResponseInner object itself. */ - public SecurityAssessmentInner withPartnersData(SecurityAssessmentPartnerData partnersData) { + public SecurityAssessmentResponseInner withPartnersData(SecurityAssessmentPartnerData partnersData) { this.partnersData = partnersData; return this; } + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatusResponse status() { + return this.status; + } + + /** + * Set the status property: The result of the assessment. + * + * @param status the status value to set. + * @return the SecurityAssessmentResponseInner object itself. + */ + public SecurityAssessmentResponseInner withStatus(AssessmentStatusResponse status) { + this.status = status; + return this; + } + /** * Validates the instance. * @@ -192,9 +194,6 @@ public void validate() { if (resourceDetails() != null) { resourceDetails().validate(); } - if (status() != null) { - status().validate(); - } if (links() != null) { links().validate(); } @@ -204,5 +203,8 @@ public void validate() { if (partnersData() != null) { partnersData().validate(); } + if (status() != null) { + status().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java index 8d3ba78f14a6..5b4149115bfd 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java @@ -30,8 +30,9 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.ExpandEnum; +import com.azure.resourcemanager.security.models.SecurityAssessment; import com.azure.resourcemanager.security.models.SecurityAssessmentList; import reactor.core.publisher.Mono; @@ -78,7 +79,7 @@ Mono> list( @Get("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @@ -91,12 +92,12 @@ Mono> get( @Put("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") SecurityAssessmentInner assessment, + @BodyParam("application/json") SecurityAssessment assessment, @HeaderParam("Accept") String accept, Context context); @@ -134,7 +135,7 @@ Mono> listNext( * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { + private Mono> listSinglePageAsync(String scope) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -144,11 +145,11 @@ private Mono> listSinglePageAsync(String if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -172,7 +173,7 @@ private Mono> listSinglePageAsync(String * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { + private Mono> listSinglePageAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -182,7 +183,7 @@ private Mono> listSinglePageAsync(String if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -209,7 +210,7 @@ private Mono> listSinglePageAsync(String * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { + private PagedFlux listAsync(String scope) { return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -225,7 +226,7 @@ private PagedFlux listAsync(String scope) { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { + private PagedFlux listAsync(String scope, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -241,7 +242,7 @@ private PagedFlux listAsync(String scope, Context conte * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { + public PagedIterable list(String scope) { return new PagedIterable<>(listAsync(scope)); } @@ -257,7 +258,7 @@ public PagedIterable list(String scope) { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { + public PagedIterable list(String scope, Context context) { return new PagedIterable<>(listAsync(scope, context)); } @@ -273,7 +274,7 @@ public PagedIterable list(String scope, Context context * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String resourceId, String assessmentName, ExpandEnum expand) { if (this.client.getEndpoint() == null) { return Mono @@ -287,7 +288,7 @@ private Mono> getWithResponseAsync( if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -311,7 +312,7 @@ private Mono> getWithResponseAsync( * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String resourceId, String assessmentName, ExpandEnum expand, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -325,7 +326,7 @@ private Mono> getWithResponseAsync( if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, expand, accept, context); @@ -343,10 +344,11 @@ private Mono> getWithResponseAsync( * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String assessmentName, ExpandEnum expand) { + private Mono getAsync( + String resourceId, String assessmentName, ExpandEnum expand) { return getWithResponseAsync(resourceId, assessmentName, expand) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -366,11 +368,11 @@ private Mono getAsync(String resourceId, String assessm * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String assessmentName) { + private Mono getAsync(String resourceId, String assessmentName) { final ExpandEnum expand = null; return getWithResponseAsync(resourceId, assessmentName, expand) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -390,7 +392,7 @@ private Mono getAsync(String resourceId, String assessm * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentInner get(String resourceId, String assessmentName) { + public SecurityAssessmentResponseInner get(String resourceId, String assessmentName) { final ExpandEnum expand = null; return getAsync(resourceId, assessmentName, expand).block(); } @@ -408,7 +410,7 @@ public SecurityAssessmentInner get(String resourceId, String assessmentName) { * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( + public Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context) { return getWithResponseAsync(resourceId, assessmentName, expand, context).block(); } @@ -423,11 +425,11 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessmentInner assessment) { + private Mono> createOrUpdateWithResponseAsync( + String resourceId, String assessmentName, SecurityAssessment assessment) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -445,7 +447,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { assessment.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -473,11 +475,11 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessmentInner assessment, Context context) { + private Mono> createOrUpdateWithResponseAsync( + String resourceId, String assessmentName, SecurityAssessment assessment, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -495,7 +497,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { assessment.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -513,14 +515,14 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceId, String assessmentName, SecurityAssessmentInner assessment) { + private Mono createOrUpdateAsync( + String resourceId, String assessmentName, SecurityAssessment assessment) { return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -539,11 +541,11 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessmentInner assessment) { + public SecurityAssessmentResponseInner createOrUpdate( + String resourceId, String assessmentName, SecurityAssessment assessment) { return createOrUpdateAsync(resourceId, assessmentName, assessment).block(); } @@ -558,11 +560,11 @@ public SecurityAssessmentInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceId, String assessmentName, SecurityAssessmentInner assessment, Context context) { + public Response createOrUpdateWithResponse( + String resourceId, String assessmentName, SecurityAssessment assessment, Context context) { return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment, context).block(); } @@ -591,7 +593,7 @@ private Mono> deleteWithResponseAsync(String resourceId, String a if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -626,7 +628,7 @@ private Mono> deleteWithResponseAsync(String resourceId, String a if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, accept, context); @@ -690,7 +692,7 @@ public Response deleteWithResponse(String resourceId, String assessmentNam * @return page of a security assessments list. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -703,7 +705,7 @@ private Mono> listNextSinglePageAsync(Str final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -726,7 +728,8 @@ private Mono> listNextSinglePageAsync(Str * @return page of a security assessments list. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java index 28f8bba8be03..bb05acd7d430 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java @@ -10,10 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.Assessments; import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.SecurityAssessment; +import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; import com.fasterxml.jackson.annotation.JsonIgnore; public final class AssessmentsImpl implements Assessments { @@ -29,35 +29,35 @@ public AssessmentsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentImpl(inner1, this.manager())); + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); } - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentImpl(inner1, this.manager())); + public PagedIterable list(String scope, Context context) { + PagedIterable inner = this.serviceClient().list(scope, context); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); } - public SecurityAssessment get(String resourceId, String assessmentName) { - SecurityAssessmentInner inner = this.serviceClient().get(resourceId, assessmentName); + public SecurityAssessmentResponse get(String resourceId, String assessmentName) { + SecurityAssessmentResponseInner inner = this.serviceClient().get(resourceId, assessmentName); if (inner != null) { - return new SecurityAssessmentImpl(inner, this.manager()); + return new SecurityAssessmentResponseImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse( + public Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context) { - Response inner = + Response inner = this.serviceClient().getWithResponse(resourceId, assessmentName, expand, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentImpl(inner.getValue(), this.manager())); + new SecurityAssessmentResponseImpl(inner.getValue(), this.manager())); } else { return null; } @@ -71,7 +71,7 @@ public Response deleteWithResponse(String resourceId, String assessmentNam return this.serviceClient().deleteWithResponse(resourceId, assessmentName, context); } - public SecurityAssessment getById(String id) { + public SecurityAssessmentResponse getById(String id) { String resourceId = Utils .getValueFromIdByParameterName( @@ -96,7 +96,7 @@ public SecurityAssessment getById(String id) { return this.getWithResponse(resourceId, assessmentName, localExpand, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, ExpandEnum expand, Context context) { + public Response getByIdWithResponse(String id, ExpandEnum expand, Context context) { String resourceId = Utils .getValueFromIdByParameterName( @@ -176,7 +176,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } - public SecurityAssessmentImpl define(String name) { - return new SecurityAssessmentImpl(name, this.manager()); + public SecurityAssessmentResponseImpl define(String name) { + return new SecurityAssessmentResponseImpl(name, this.manager()); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java index ac3a2f2b5cae..941842a8074a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java @@ -30,8 +30,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataList; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponseList; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. */ @@ -67,7 +67,7 @@ private interface AssessmentsMetadatasService { @Get("/providers/Microsoft.Security/assessmentMetadata") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -77,7 +77,7 @@ Mono> list( @Get("/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @@ -88,7 +88,7 @@ Mono> get( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( + Mono> listBySubscription( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -99,7 +99,7 @@ Mono> listBySubscription( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInSubscription( + Mono> getInSubscription( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @@ -111,12 +111,12 @@ Mono> getInSubscription( @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createInSubscription( + Mono> createInSubscription( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SecurityAssessmentMetadataInner assessmentMetadata, + @BodyParam("application/json") SecurityAssessmentMetadataResponseInner assessmentMetadata, @HeaderParam("Accept") String accept, Context context); @@ -137,7 +137,7 @@ Mono> deleteInSubscription( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -147,7 +147,7 @@ Mono> listNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -162,18 +162,18 @@ Mono> listBySubscriptionNext( * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -195,14 +195,14 @@ private Mono> listSinglePageAsync * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -226,7 +226,7 @@ private Mono> listSinglePageAsync * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -240,7 +240,7 @@ private PagedFlux listAsync() { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>( () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -253,7 +253,7 @@ private PagedFlux listAsync(Context context) { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } @@ -267,7 +267,7 @@ public PagedIterable list() { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } @@ -281,7 +281,8 @@ public PagedIterable list(Context context) { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String assessmentMetadataName) { + private Mono> getWithResponseAsync( + String assessmentMetadataName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -293,7 +294,7 @@ private Mono> getWithResponseAsync(Str .error( new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -312,7 +313,7 @@ private Mono> getWithResponseAsync(Str * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String assessmentMetadataName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -325,7 +326,7 @@ private Mono> getWithResponseAsync( .error( new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, assessmentMetadataName, accept, context); @@ -341,10 +342,10 @@ private Mono> getWithResponseAsync( * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String assessmentMetadataName) { + private Mono getAsync(String assessmentMetadataName) { return getWithResponseAsync(assessmentMetadataName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -363,7 +364,7 @@ private Mono getAsync(String assessmentMetadata * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataInner get(String assessmentMetadataName) { + public SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName) { return getAsync(assessmentMetadataName).block(); } @@ -378,7 +379,8 @@ public SecurityAssessmentMetadataInner get(String assessmentMetadataName) { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String assessmentMetadataName, Context context) { + public Response getWithResponse( + String assessmentMetadataName, Context context) { return getWithResponseAsync(assessmentMetadataName, context).block(); } @@ -390,7 +392,7 @@ public Response getWithResponse(String assessme * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync() { + private Mono> listBySubscriptionSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -403,7 +405,7 @@ private Mono> listBySubscriptionS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -411,7 +413,7 @@ private Mono> listBySubscriptionS service .listBySubscription( this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -433,7 +435,8 @@ private Mono> listBySubscriptionS * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync(Context context) { + private Mono> listBySubscriptionSinglePageAsync( + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -446,7 +449,7 @@ private Mono> listBySubscriptionS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -470,7 +473,7 @@ private Mono> listBySubscriptionS * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync() { + private PagedFlux listBySubscriptionAsync() { return new PagedFlux<>( () -> listBySubscriptionSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } @@ -485,7 +488,7 @@ private PagedFlux listBySubscriptionAsync() { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Context context) { + private PagedFlux listBySubscriptionAsync(Context context) { return new PagedFlux<>( () -> listBySubscriptionSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); @@ -499,7 +502,7 @@ private PagedFlux listBySubscriptionAsync(Conte * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { + public PagedIterable listBySubscription() { return new PagedIterable<>(listBySubscriptionAsync()); } @@ -513,7 +516,7 @@ public PagedIterable listBySubscription() { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Context context) { + public PagedIterable listBySubscription(Context context) { return new PagedIterable<>(listBySubscriptionAsync(context)); } @@ -527,7 +530,7 @@ public PagedIterable listBySubscription(Context * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( + private Mono> getInSubscriptionWithResponseAsync( String assessmentMetadataName) { if (this.client.getEndpoint() == null) { return Mono @@ -546,7 +549,7 @@ private Mono> getInSubscriptionWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -573,7 +576,7 @@ private Mono> getInSubscriptionWithRes * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( + private Mono> getInSubscriptionWithResponseAsync( String assessmentMetadataName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -592,7 +595,7 @@ private Mono> getInSubscriptionWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -615,10 +618,10 @@ private Mono> getInSubscriptionWithRes * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getInSubscriptionAsync(String assessmentMetadataName) { + private Mono getInSubscriptionAsync(String assessmentMetadataName) { return getInSubscriptionWithResponseAsync(assessmentMetadataName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -637,7 +640,7 @@ private Mono getInSubscriptionAsync(String asse * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataInner getInSubscription(String assessmentMetadataName) { + public SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName) { return getInSubscriptionAsync(assessmentMetadataName).block(); } @@ -652,7 +655,7 @@ public SecurityAssessmentMetadataInner getInSubscription(String assessmentMetada * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInSubscriptionWithResponse( + public Response getInSubscriptionWithResponse( String assessmentMetadataName, Context context) { return getInSubscriptionWithResponseAsync(assessmentMetadataName, context).block(); } @@ -665,11 +668,11 @@ public Response getInSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata) { + private Mono> createInSubscriptionWithResponseAsync( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -693,7 +696,7 @@ private Mono> createInSubscriptionWith } else { assessmentMetadata.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -719,11 +722,11 @@ private Mono> createInSubscriptionWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata, Context context) { + private Mono> createInSubscriptionWithResponseAsync( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -747,7 +750,7 @@ private Mono> createInSubscriptionWith } else { assessmentMetadata.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -769,14 +772,14 @@ private Mono> createInSubscriptionWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInSubscriptionAsync( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata) { + private Mono createInSubscriptionAsync( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -793,11 +796,11 @@ private Mono createInSubscriptionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata) { + public SecurityAssessmentMetadataResponseInner createInSubscription( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { return createInSubscriptionAsync(assessmentMetadataName, assessmentMetadata).block(); } @@ -810,11 +813,11 @@ public SecurityAssessmentMetadataInner createInSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata, Context context) { + public Response createInSubscriptionWithResponse( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata, context).block(); } @@ -847,7 +850,7 @@ private Mono> deleteInSubscriptionWithResponseAsync(String assess new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -893,7 +896,7 @@ private Mono> deleteInSubscriptionWithResponseAsync(String assess new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -962,7 +965,7 @@ public Response deleteInSubscriptionWithResponse(String assessmentMetadata * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -975,7 +978,7 @@ private Mono> listNextSinglePageA final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -998,7 +1001,7 @@ private Mono> listNextSinglePageA * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( + private Mono> listNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1034,7 +1037,7 @@ private Mono> listNextSinglePageA * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( + private Mono> listBySubscriptionNextSinglePageAsync( String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1049,7 +1052,7 @@ private Mono> listBySubscriptionN return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1072,7 +1075,7 @@ private Mono> listBySubscriptionN * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( + private Mono> listBySubscriptionNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java index 710b457adbd1..bda93bc05522 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java @@ -10,9 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadata; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; import com.fasterxml.jackson.annotation.JsonIgnore; public final class AssessmentsMetadatasImpl implements AssessmentsMetadatas { @@ -28,68 +28,69 @@ public AssessmentsMetadatasImpl( this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public SecurityAssessmentMetadata get(String assessmentMetadataName) { - SecurityAssessmentMetadataInner inner = this.serviceClient().get(assessmentMetadataName); + public SecurityAssessmentMetadataResponse get(String assessmentMetadataName) { + SecurityAssessmentMetadataResponseInner inner = this.serviceClient().get(assessmentMetadataName); if (inner != null) { - return new SecurityAssessmentMetadataImpl(inner, this.manager()); + return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse(String assessmentMetadataName, Context context) { - Response inner = + public Response getWithResponse( + String assessmentMetadataName, Context context) { + Response inner = this.serviceClient().getWithResponse(assessmentMetadataName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentMetadataImpl(inner.getValue(), this.manager())); + new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public PagedIterable listBySubscription() { - PagedIterable inner = this.serviceClient().listBySubscription(); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public PagedIterable listBySubscription(Context context) { - PagedIterable inner = this.serviceClient().listBySubscription(context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable listBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(context); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public SecurityAssessmentMetadata getInSubscription(String assessmentMetadataName) { - SecurityAssessmentMetadataInner inner = this.serviceClient().getInSubscription(assessmentMetadataName); + public SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName) { + SecurityAssessmentMetadataResponseInner inner = this.serviceClient().getInSubscription(assessmentMetadataName); if (inner != null) { - return new SecurityAssessmentMetadataImpl(inner, this.manager()); + return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); } else { return null; } } - public Response getInSubscriptionWithResponse( + public Response getInSubscriptionWithResponse( String assessmentMetadataName, Context context) { - Response inner = + Response inner = this.serviceClient().getInSubscriptionWithResponse(assessmentMetadataName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentMetadataImpl(inner.getValue(), this.manager())); + new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); } else { return null; } @@ -103,7 +104,7 @@ public Response deleteInSubscriptionWithResponse(String assessmentMetadata return this.serviceClient().deleteInSubscriptionWithResponse(assessmentMetadataName, context); } - public SecurityAssessmentMetadata getInSubscriptionById(String id) { + public SecurityAssessmentMetadataResponse getInSubscriptionById(String id) { String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); if (assessmentMetadataName == null) { throw logger @@ -116,7 +117,7 @@ public SecurityAssessmentMetadata getInSubscriptionById(String id) { return this.getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); } - public Response getInSubscriptionByIdWithResponse(String id, Context context) { + public Response getInSubscriptionByIdWithResponse(String id, Context context) { String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); if (assessmentMetadataName == null) { throw logger @@ -163,7 +164,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } - public SecurityAssessmentMetadataImpl define(String name) { - return new SecurityAssessmentMetadataImpl(name, this.manager()); + public SecurityAssessmentMetadataResponseImpl define(String name) { + return new SecurityAssessmentMetadataResponseImpl(name, this.manager()); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java new file mode 100644 index 000000000000..df687f6817cb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +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.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 String compressedQuery() { + return this.innerModel().compressedQuery(); + } + + public SupportedCloudEnum supportedCloud() { + return this.innerModel().supportedCloud(); + } + + public SeverityEnum severity() { + return this.innerModel().severity(); + } + + public String description() { + return this.innerModel().description(); + } + + public String remediationDescription() { + return this.innerModel().remediationDescription(); + } + + public CustomAssessmentAutomationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String customAssessmentAutomationName; + + public CustomAssessmentAutomationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CustomAssessmentAutomation create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomAssessmentAutomations() + .createWithResponse(resourceGroupName, customAssessmentAutomationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public CustomAssessmentAutomation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomAssessmentAutomations() + .createWithResponse(resourceGroupName, customAssessmentAutomationName, this.innerModel(), context) + .getValue(); + return this; + } + + CustomAssessmentAutomationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new CustomAssessmentAutomationInner(); + this.serviceManager = serviceManager; + this.customAssessmentAutomationName = name; + } + + 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.innerModel().withCompressedQuery(compressedQuery); + return this; + } + + public CustomAssessmentAutomationImpl withSupportedCloud(SupportedCloudEnum supportedCloud) { + this.innerModel().withSupportedCloud(supportedCloud); + return this; + } + + public CustomAssessmentAutomationImpl withSeverity(SeverityEnum severity) { + this.innerModel().withSeverity(severity); + return this; + } + + public CustomAssessmentAutomationImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public CustomAssessmentAutomationImpl withRemediationDescription(String remediationDescription) { + this.innerModel().withRemediationDescription(remediationDescription); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java new file mode 100644 index 000000000000..58af491ad082 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java @@ -0,0 +1,1138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomationsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ +public final class CustomAssessmentAutomationsClientImpl implements CustomAssessmentAutomationsClient { + private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomAssessmentAutomationsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of CustomAssessmentAutomationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomAssessmentAutomationsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + CustomAssessmentAutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterCustomAssessmentAutomations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterCustom") + private interface CustomAssessmentAutomationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, + @BodyParam("application/json") CustomAssessmentAutomationInner customAssessmentAutomationBody, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String customAssessmentAutomationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomAssessmentAutomationInner getByResourceGroup( + String resourceGroupName, String customAssessmentAutomationName) { + return getByResourceGroupAsync(resourceGroupName, customAssessmentAutomationName).block(); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + if (customAssessmentAutomationBody == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationBody is required and cannot be null.")); + } else { + customAssessmentAutomationBody.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + customAssessmentAutomationBody, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + if (customAssessmentAutomationBody == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationBody is required and cannot be null.")); + } else { + customAssessmentAutomationBody.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + customAssessmentAutomationBody, + accept, + context); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody) { + return createWithResponseAsync( + resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomAssessmentAutomationInner create( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody) { + return createAsync(resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody).block(); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationInner customAssessmentAutomationBody, + Context context) { + return createWithResponseAsync( + resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, context) + .block(); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String customAssessmentAutomationName) { + return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String customAssessmentAutomationName) { + deleteAsync(resourceGroupName, customAssessmentAutomationName).block(); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List custom assessment automations by provided subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List custom assessment automations by provided subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List custom assessment automations by provided subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List custom assessment automations by provided subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List custom assessment automations by provided subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List custom assessment automations by provided subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java new file mode 100644 index 000000000000..fdf5e6031646 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomation; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomAssessmentAutomationsImpl implements CustomAssessmentAutomations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationsImpl.class); + + private final CustomAssessmentAutomationsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public CustomAssessmentAutomationsImpl( + CustomAssessmentAutomationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CustomAssessmentAutomation getByResourceGroup( + String resourceGroupName, String customAssessmentAutomationName) { + CustomAssessmentAutomationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, customAssessmentAutomationName); + if (inner != null) { + return new CustomAssessmentAutomationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomAssessmentAutomationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String customAssessmentAutomationName) { + this.serviceClient().delete(resourceGroupName, customAssessmentAutomationName); + } + + public Response deleteWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public CustomAssessmentAutomation getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + this.deleteWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); + } + + private CustomAssessmentAutomationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public CustomAssessmentAutomationImpl define(String name) { + return new CustomAssessmentAutomationImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java deleted file mode 100644 index bd7d057a552e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.AuthorizationState; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.DeviceCriticality; -import com.azure.resourcemanager.security.models.DeviceStatus; -import com.azure.resourcemanager.security.models.Firmware; -import com.azure.resourcemanager.security.models.ManagementState; -import com.azure.resourcemanager.security.models.NetworkInterface; -import com.azure.resourcemanager.security.models.ProgrammingState; -import com.azure.resourcemanager.security.models.Protocol; -import com.azure.resourcemanager.security.models.PurdueLevel; -import com.azure.resourcemanager.security.models.ScanningFunctionality; -import com.azure.resourcemanager.security.models.Sensor; -import com.azure.resourcemanager.security.models.Site; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class DeviceImpl implements Device { - private DeviceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DeviceImpl(DeviceInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String deviceType() { - return this.innerModel().deviceType(); - } - - public String sourceName() { - return this.innerModel().sourceName(); - } - - public List networkInterfaces() { - List inner = this.innerModel().networkInterfaces(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String vendor() { - return this.innerModel().vendor(); - } - - public String osName() { - return this.innerModel().osName(); - } - - public List protocols() { - List inner = this.innerModel().protocols(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime lastActiveTime() { - return this.innerModel().lastActiveTime(); - } - - public OffsetDateTime lastUpdateTime() { - return this.innerModel().lastUpdateTime(); - } - - public ManagementState managementState() { - return this.innerModel().managementState(); - } - - public AuthorizationState authorizationState() { - return this.innerModel().authorizationState(); - } - - public DeviceCriticality deviceCriticality() { - return this.innerModel().deviceCriticality(); - } - - public PurdueLevel purdueLevel() { - return this.innerModel().purdueLevel(); - } - - public String notes() { - return this.innerModel().notes(); - } - - public List firmwares() { - List inner = this.innerModel().firmwares(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime discoveryTime() { - return this.innerModel().discoveryTime(); - } - - public ProgrammingState programmingState() { - return this.innerModel().programmingState(); - } - - public OffsetDateTime lastProgrammingTime() { - return this.innerModel().lastProgrammingTime(); - } - - public ScanningFunctionality scanningFunctionality() { - return this.innerModel().scanningFunctionality(); - } - - public OffsetDateTime lastScanTime() { - return this.innerModel().lastScanTime(); - } - - public Integer riskScore() { - return this.innerModel().riskScore(); - } - - public List sensors() { - List inner = this.innerModel().sensors(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Site site() { - return this.innerModel().site(); - } - - public DeviceStatus deviceStatus() { - return this.innerModel().deviceStatus(); - } - - public DeviceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java deleted file mode 100644 index d34756166cac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DevicesClient. */ -public final class DevicesClientImpl implements DevicesClient { - private final ClientLogger logger = new ClientLogger(DevicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DevicesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevices to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - private interface DevicesService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/devices/{deviceId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceId") String deviceId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String deviceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceId == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, deviceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String deviceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceId == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, deviceId, accept, context); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String deviceId) { - return getWithResponseAsync(resourceId, deviceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner get(String resourceId, String deviceId) { - return getAsync(resourceId, deviceId).block(); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String deviceId, Context context) { - return getWithResponseAsync(resourceId, deviceId, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java deleted file mode 100644 index ddee689ac4ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForHubsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.DeviceList; -import com.azure.resourcemanager.security.models.ManagementState; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DevicesForHubsClient. */ -public final class DevicesForHubsClientImpl implements DevicesForHubsClient { - private final ClientLogger logger = new ClientLogger(DevicesForHubsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DevicesForHubsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevicesForHubsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesForHubsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(DevicesForHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevicesForHubs to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - private interface DevicesForHubsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/devices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @QueryParam("deviceManagementType") ManagementState deviceManagementType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - resourceId, - limit, - skipToken, - deviceManagementType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - resourceId, - limit, - skipToken, - deviceManagementType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, limit, skipToken, deviceManagementType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedIterable<>(listAsync(resourceId, limit, skipToken, deviceManagementType)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedIterable<>(listAsync(resourceId, limit, skipToken, deviceManagementType, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsImpl.java deleted file mode 100644 index c767b26ae791..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForHubsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.DevicesForHubs; -import com.azure.resourcemanager.security.models.ManagementState; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class DevicesForHubsImpl implements DevicesForHubs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesForHubsImpl.class); - - private final DevicesForHubsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevicesForHubsImpl( - DevicesForHubsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceId) { - PagedIterable inner = this.serviceClient().list(resourceId); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceId, limit, skipToken, deviceManagementType, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - private DevicesForHubsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsClientImpl.java deleted file mode 100644 index 11c37fd3a56d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsClientImpl.java +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForSubscriptionsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.DeviceList; -import com.azure.resourcemanager.security.models.ManagementState; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DevicesForSubscriptionsClient. */ -public final class DevicesForSubscriptionsClientImpl implements DevicesForSubscriptionsClient { - private final ClientLogger logger = new ClientLogger(DevicesForSubscriptionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DevicesForSubscriptionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevicesForSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesForSubscriptionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(DevicesForSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevicesForSubscriptions to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - private interface DevicesForSubscriptionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/devices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @QueryParam("deviceManagementType") ManagementState deviceManagementType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer limit, String skipToken, ManagementState deviceManagementType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - limit, - skipToken, - deviceManagementType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - limit, - skipToken, - deviceManagementType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer limit, String skipToken, ManagementState deviceManagementType) { - return new PagedFlux<>( - () -> listSinglePageAsync(limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices by their subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(limit, skipToken, deviceManagementType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of the devices by their subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedIterable<>(listAsync(limit, skipToken, deviceManagementType)); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedIterable<>(listAsync(limit, skipToken, deviceManagementType, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsImpl.java deleted file mode 100644 index 8bf12d31599f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForSubscriptionsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.DevicesForSubscriptions; -import com.azure.resourcemanager.security.models.ManagementState; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class DevicesForSubscriptionsImpl implements DevicesForSubscriptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesForSubscriptionsImpl.class); - - private final DevicesForSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevicesForSubscriptionsImpl( - DevicesForSubscriptionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable list( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - PagedIterable inner = this.serviceClient().list(limit, skipToken, deviceManagementType, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - private DevicesForSubscriptionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesImpl.java deleted file mode 100644 index f3391fbd664d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.Devices; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class DevicesImpl implements Devices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesImpl.class); - - private final DevicesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevicesImpl(DevicesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Device get(String resourceId, String deviceId) { - DeviceInner inner = this.serviceClient().get(resourceId, deviceId); - if (inner != null) { - return new DeviceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String resourceId, String deviceId, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceId, deviceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DeviceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private DevicesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.java deleted file mode 100644 index c236b0feb0a4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.IotAlertModel; -import java.util.Collections; -import java.util.List; - -public final class IotAlertModelImpl implements IotAlertModel { - private IotAlertModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotAlertModelImpl( - IotAlertModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String systemAlertId() { - return this.innerModel().systemAlertId(); - } - - public String compromisedEntity() { - return this.innerModel().compromisedEntity(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public String startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public String endTimeUtc() { - return this.innerModel().endTimeUtc(); - } - - public List entities() { - List inner = this.innerModel().entities(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Object extendedProperties() { - return this.innerModel().extendedProperties(); - } - - public IotAlertModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeImpl.java deleted file mode 100644 index 2a3af4367be5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.models.AlertIntent; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.IotAlertType; -import java.util.Collections; -import java.util.List; - -public final class IotAlertTypeImpl implements IotAlertType { - private IotAlertTypeInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotAlertTypeImpl(IotAlertTypeInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String alertDisplayName() { - return this.innerModel().alertDisplayName(); - } - - public AlertSeverity severity() { - return this.innerModel().severity(); - } - - public String description() { - return this.innerModel().description(); - } - - public String providerName() { - return this.innerModel().providerName(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public String productComponentName() { - return this.innerModel().productComponentName(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public AlertIntent intent() { - return this.innerModel().intent(); - } - - public List remediationSteps() { - List inner = this.innerModel().remediationSteps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public IotAlertTypeInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeListImpl.java deleted file mode 100644 index 70c5b894a55d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeListImpl.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.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; -import com.azure.resourcemanager.security.models.IotAlertType; -import com.azure.resourcemanager.security.models.IotAlertTypeList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotAlertTypeListImpl implements IotAlertTypeList { - private IotAlertTypeListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotAlertTypeListImpl( - IotAlertTypeListInner 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 IotAlertTypeImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotAlertTypeListInner 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/IotAlertTypesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesClientImpl.java deleted file mode 100644 index ac01b45500fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesClientImpl.java +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotAlertTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotAlertTypesClient. */ -public final class IotAlertTypesClientImpl implements IotAlertTypesClient { - private final ClientLogger logger = new ClientLogger(IotAlertTypesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotAlertTypesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotAlertTypesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotAlertTypesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotAlertTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotAlertTypes to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotAle") - private interface IotAlertTypesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes") - @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/iotAlertTypes/{iotAlertTypeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("iotAlertTypeName") String iotAlertTypeName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT alert types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT alert types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List IoT alert types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT alert types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotAlertTypeListInner list() { - return listAsync().block(); - } - - /** - * List IoT alert types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String iotAlertTypeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (iotAlertTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotAlertTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotAlertTypeName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String iotAlertTypeName, 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 (iotAlertTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotAlertTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotAlertTypeName, - accept, - context); - } - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String iotAlertTypeName) { - return getWithResponseAsync(iotAlertTypeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotAlertTypeInner get(String iotAlertTypeName) { - return getAsync(iotAlertTypeName).block(); - } - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String iotAlertTypeName, Context context) { - return getWithResponseAsync(iotAlertTypeName, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesImpl.java deleted file mode 100644 index e60002db92f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotAlertTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; -import com.azure.resourcemanager.security.models.IotAlertType; -import com.azure.resourcemanager.security.models.IotAlertTypeList; -import com.azure.resourcemanager.security.models.IotAlertTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotAlertTypesImpl implements IotAlertTypes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertTypesImpl.class); - - private final IotAlertTypesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotAlertTypesImpl( - IotAlertTypesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotAlertTypeList list() { - IotAlertTypeListInner inner = this.serviceClient().list(); - if (inner != null) { - return new IotAlertTypeListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotAlertTypeListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotAlertType get(String iotAlertTypeName) { - IotAlertTypeInner inner = this.serviceClient().get(iotAlertTypeName); - if (inner != null) { - return new IotAlertTypeImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String iotAlertTypeName, Context context) { - Response inner = this.serviceClient().getWithResponse(iotAlertTypeName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotAlertTypeImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotAlertTypesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsClientImpl.java deleted file mode 100644 index 1ee5d3f55baf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsClientImpl.java +++ /dev/null @@ -1,620 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.IotAlertListModel; -import com.azure.resourcemanager.security.models.ManagementState; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotAlertsClient. */ -public final class IotAlertsClientImpl implements IotAlertsClient { - private final ClientLogger logger = new ClientLogger(IotAlertsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotAlertsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotAlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotAlertsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotAlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotAlerts to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotAle") - private interface IotAlertsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("startTimeUtc>") String minStartTimeUtc, - @QueryParam("startTimeUtc<") String maxStartTimeUtc, - @QueryParam("alertType") String alertType, - @QueryParam("deviceManagementType") ManagementState deviceManagementType, - @QueryParam("compromisedEntity") String compromisedEntity, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotAlertId") String iotAlertId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - final String minStartTimeUtc = null; - final String maxStartTimeUtc = null; - final String alertType = null; - final ManagementState deviceManagementType = null; - final String compromisedEntity = null; - final Integer limit = null; - final String skipToken = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - final String minStartTimeUtc = null; - final String maxStartTimeUtc = null; - final String alertType = null; - final ManagementState deviceManagementType = null; - final String compromisedEntity = null; - final Integer limit = null; - final String skipToken = null; - return new PagedIterable<>( - listAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - return new PagedIterable<>( - listAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - context)); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotAlertId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotAlertId == null) { - return Mono.error(new IllegalArgumentException("Parameter iotAlertId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, iotAlertId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotAlertId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotAlertId == null) { - return Mono.error(new IllegalArgumentException("Parameter iotAlertId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, iotAlertId, accept, context); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String iotAlertId) { - return getWithResponseAsync(scope, iotAlertId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotAlertModelInner get(String scope, String iotAlertId) { - return getAsync(scope, iotAlertId).block(); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String iotAlertId, Context context) { - return getWithResponseAsync(scope, iotAlertId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsImpl.java deleted file mode 100644 index 95150c29779e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.IotAlertModel; -import com.azure.resourcemanager.security.models.IotAlerts; -import com.azure.resourcemanager.security.models.ManagementState; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotAlertsImpl implements IotAlerts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertsImpl.class); - - private final IotAlertsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotAlertsImpl( - IotAlertsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new IotAlertModelImpl(inner1, this.manager())); - } - - public PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - context); - return Utils.mapPage(inner, inner1 -> new IotAlertModelImpl(inner1, this.manager())); - } - - public IotAlertModel get(String scope, String iotAlertId) { - IotAlertModelInner inner = this.serviceClient().get(scope, iotAlertId); - if (inner != null) { - return new IotAlertModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, String iotAlertId, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, iotAlertId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotAlertModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotAlertsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsClientImpl.java deleted file mode 100644 index 0adb99c46e36..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsClientImpl.java +++ /dev/null @@ -1,819 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotDefenderSettingsClient; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotDefenderSettingsClient. */ -public final class IotDefenderSettingsClientImpl implements IotDefenderSettingsClient { - private final ClientLogger logger = new ClientLogger(IotDefenderSettingsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotDefenderSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotDefenderSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotDefenderSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotDefenderSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotDefenderSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotDef") - private interface IotDefenderSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") IotDefenderSettingsModelInner iotDefenderSettingsModel, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> packageDownloads( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default" - + "/downloadManagerActivation") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadManagerActivation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotDefenderSettingsListInner list() { - return listAsync().block(); - } - - /** - * List IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Get IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotDefenderSettingsModelInner get() { - return getAsync().block(); - } - - /** - * Get IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - IotDefenderSettingsModelInner iotDefenderSettingsModel) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (iotDefenderSettingsModel == null) { - return Mono - .error( - new IllegalArgumentException("Parameter iotDefenderSettingsModel is required and cannot be null.")); - } else { - iotDefenderSettingsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotDefenderSettingsModel, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (iotDefenderSettingsModel == null) { - return Mono - .error( - new IllegalArgumentException("Parameter iotDefenderSettingsModel is required and cannot be null.")); - } else { - iotDefenderSettingsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotDefenderSettingsModel, - accept, - context); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - IotDefenderSettingsModelInner iotDefenderSettingsModel) { - return createOrUpdateWithResponseAsync(iotDefenderSettingsModel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotDefenderSettingsModelInner createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel) { - return createOrUpdateAsync(iotDefenderSettingsModel).block(); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context) { - return createOrUpdateWithResponseAsync(iotDefenderSettingsModel, context).block(); - } - - /** - * Delete IoT Defender settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete IoT Defender settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Delete IoT Defender settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync() { - return deleteWithResponseAsync().flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete IoT Defender settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete() { - deleteAsync().block(); - } - - /** - * Delete IoT Defender settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(Context context) { - return deleteWithResponseAsync(context).block(); - } - - /** - * Information about downloadable packages. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> packageDownloadsWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .packageDownloads( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> packageDownloadsWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .packageDownloads(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Information about downloadable packages. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono packageDownloadsAsync() { - return packageDownloadsWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Information about downloadable packages. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PackageDownloadsInner packageDownloads() { - return packageDownloadsAsync().block(); - } - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response packageDownloadsWithResponse(Context context) { - return packageDownloadsWithResponseAsync(context).block(); - } - - /** - * Download manager activation data defined for this subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadManagerActivationWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadManagerActivation( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download manager activation data defined for this subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadManagerActivationWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadManagerActivation( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Download manager activation data defined for this subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadManagerActivationAsync() { - return downloadManagerActivationWithResponseAsync().flatMapMany(StreamResponse::getValue); - } - - /** - * Download manager activation data defined for this subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadManagerActivation() { - Iterator iterator = - downloadManagerActivationAsync().map(ByteBufferBackedInputStream::new).toStream().iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download manager activation data defined for this subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadManagerActivationWithResponse(Context context) { - return downloadManagerActivationWithResponseAsync(context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java deleted file mode 100644 index 506af402e27f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotDefenderSettingsClient; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import com.azure.resourcemanager.security.models.IotDefenderSettings; -import com.azure.resourcemanager.security.models.IotDefenderSettingsList; -import com.azure.resourcemanager.security.models.IotDefenderSettingsModel; -import com.azure.resourcemanager.security.models.PackageDownloads; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.io.InputStream; - -public final class IotDefenderSettingsImpl implements IotDefenderSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDefenderSettingsImpl.class); - - private final IotDefenderSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotDefenderSettingsImpl( - IotDefenderSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotDefenderSettingsList list() { - IotDefenderSettingsListInner inner = this.serviceClient().list(); - if (inner != null) { - return new IotDefenderSettingsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotDefenderSettingsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotDefenderSettingsModel get() { - IotDefenderSettingsModelInner inner = this.serviceClient().get(); - if (inner != null) { - return new IotDefenderSettingsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotDefenderSettingsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotDefenderSettingsModel createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel) { - IotDefenderSettingsModelInner inner = this.serviceClient().createOrUpdate(iotDefenderSettingsModel); - if (inner != null) { - return new IotDefenderSettingsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(iotDefenderSettingsModel, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotDefenderSettingsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete() { - this.serviceClient().delete(); - } - - public Response deleteWithResponse(Context context) { - return this.serviceClient().deleteWithResponse(context); - } - - public PackageDownloads packageDownloads() { - PackageDownloadsInner inner = this.serviceClient().packageDownloads(); - if (inner != null) { - return new PackageDownloadsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response packageDownloadsWithResponse(Context context) { - Response inner = this.serviceClient().packageDownloadsWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PackageDownloadsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public InputStream downloadManagerActivation() { - return this.serviceClient().downloadManagerActivation(); - } - - public StreamResponse downloadManagerActivationWithResponse(Context context) { - return this.serviceClient().downloadManagerActivationWithResponse(context); - } - - private IotDefenderSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsListImpl.java deleted file mode 100644 index 07b65d4755b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsListImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.models.IotDefenderSettingsList; -import com.azure.resourcemanager.security.models.IotDefenderSettingsModel; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotDefenderSettingsListImpl implements IotDefenderSettingsList { - private IotDefenderSettingsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotDefenderSettingsListImpl( - IotDefenderSettingsListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new IotDefenderSettingsModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotDefenderSettingsListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsModelImpl.java deleted file mode 100644 index 62417551af92..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsModelImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.models.IotDefenderSettingsModel; -import com.azure.resourcemanager.security.models.OnboardingKind; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class IotDefenderSettingsModelImpl implements IotDefenderSettingsModel { - private IotDefenderSettingsModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotDefenderSettingsModelImpl( - IotDefenderSettingsModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Integer deviceQuota() { - return this.innerModel().deviceQuota(); - } - - public List sentinelWorkspaceResourceIds() { - List inner = this.innerModel().sentinelWorkspaceResourceIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OnboardingKind onboardingKind() { - return this.innerModel().onboardingKind(); - } - - public OffsetDateTime evaluationEndTime() { - return this.innerModel().evaluationEndTime(); - } - - public IotDefenderSettingsModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationModelImpl.java deleted file mode 100644 index 74ff6238816d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationModelImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.azure.resourcemanager.security.models.IotRecommendationModel; - -public final class IotRecommendationModelImpl implements IotRecommendationModel { - private IotRecommendationModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotRecommendationModelImpl( - IotRecommendationModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String deviceId() { - return this.innerModel().deviceId(); - } - - public String recommendationType() { - return this.innerModel().recommendationType(); - } - - public String discoveredTimeUtc() { - return this.innerModel().discoveredTimeUtc(); - } - - public Object recommendationAdditionalData() { - return this.innerModel().recommendationAdditionalData(); - } - - public IotRecommendationModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeImpl.java deleted file mode 100644 index 1620c9ef5537..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.models.IotRecommendationType; -import com.azure.resourcemanager.security.models.RecommendationSeverity; -import java.util.Collections; -import java.util.List; - -public final class IotRecommendationTypeImpl implements IotRecommendationType { - private IotRecommendationTypeInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotRecommendationTypeImpl( - IotRecommendationTypeInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String recommendationDisplayName() { - return this.innerModel().recommendationDisplayName(); - } - - public RecommendationSeverity severity() { - return this.innerModel().severity(); - } - - public String description() { - return this.innerModel().description(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public String productComponentName() { - return this.innerModel().productComponentName(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public String control() { - return this.innerModel().control(); - } - - public List remediationSteps() { - List inner = this.innerModel().remediationSteps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String dataSource() { - return this.innerModel().dataSource(); - } - - public IotRecommendationTypeInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeListImpl.java deleted file mode 100644 index b5df59664d33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeListImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import com.azure.resourcemanager.security.models.IotRecommendationType; -import com.azure.resourcemanager.security.models.IotRecommendationTypeList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotRecommendationTypeListImpl implements IotRecommendationTypeList { - private IotRecommendationTypeListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotRecommendationTypeListImpl( - IotRecommendationTypeListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new IotRecommendationTypeImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotRecommendationTypeListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesClientImpl.java deleted file mode 100644 index 1072304d9bca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesClientImpl.java +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotRecommendationTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotRecommendationTypesClient. */ -public final class IotRecommendationTypesClientImpl implements IotRecommendationTypesClient { - private final ClientLogger logger = new ClientLogger(IotRecommendationTypesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotRecommendationTypesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotRecommendationTypesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotRecommendationTypesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(IotRecommendationTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotRecommendationTypes to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotRec") - private interface IotRecommendationTypesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes" - + "/{iotRecommendationTypeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("iotRecommendationTypeName") String iotRecommendationTypeName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT recommendation types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List IoT recommendation types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT recommendation types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotRecommendationTypeListInner list() { - return listAsync().block(); - } - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String iotRecommendationTypeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (iotRecommendationTypeName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter iotRecommendationTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotRecommendationTypeName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String iotRecommendationTypeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (iotRecommendationTypeName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter iotRecommendationTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotRecommendationTypeName, - accept, - context); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String iotRecommendationTypeName) { - return getWithResponseAsync(iotRecommendationTypeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotRecommendationTypeInner get(String iotRecommendationTypeName) { - return getAsync(iotRecommendationTypeName).block(); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String iotRecommendationTypeName, Context context) { - return getWithResponseAsync(iotRecommendationTypeName, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.java deleted file mode 100644 index 6954641f9605..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotRecommendationTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import com.azure.resourcemanager.security.models.IotRecommendationType; -import com.azure.resourcemanager.security.models.IotRecommendationTypeList; -import com.azure.resourcemanager.security.models.IotRecommendationTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotRecommendationTypesImpl implements IotRecommendationTypes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationTypesImpl.class); - - private final IotRecommendationTypesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotRecommendationTypesImpl( - IotRecommendationTypesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotRecommendationTypeList list() { - IotRecommendationTypeListInner inner = this.serviceClient().list(); - if (inner != null) { - return new IotRecommendationTypeListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotRecommendationTypeListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotRecommendationType get(String iotRecommendationTypeName) { - IotRecommendationTypeInner inner = this.serviceClient().get(iotRecommendationTypeName); - if (inner != null) { - return new IotRecommendationTypeImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String iotRecommendationTypeName, Context context) { - Response inner = - this.serviceClient().getWithResponse(iotRecommendationTypeName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotRecommendationTypeImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotRecommendationTypesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsClientImpl.java deleted file mode 100644 index a18eeacf9bf8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsClientImpl.java +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.azure.resourcemanager.security.models.IotRecommendationListModel; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotRecommendationsClient. */ -public final class IotRecommendationsClientImpl implements IotRecommendationsClient { - private final ClientLogger logger = new ClientLogger(IotRecommendationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotRecommendationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotRecommendationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotRecommendationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotRecommendationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotRecommendations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotRec") - private interface IotRecommendationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotRecommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("recommendationType") String recommendationType, - @QueryParam("deviceId") String deviceId, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotRecommendationId") String iotRecommendationId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - recommendationType, - deviceId, - limit, - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - recommendationType, - deviceId, - limit, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, recommendationType, deviceId, limit, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - final String recommendationType = null; - final String deviceId = null; - final Integer limit = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(scope, recommendationType, deviceId, limit, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, recommendationType, deviceId, limit, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - final String recommendationType = null; - final String deviceId = null; - final Integer limit = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(scope, recommendationType, deviceId, limit, skipToken)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - return new PagedIterable<>(listAsync(scope, recommendationType, deviceId, limit, skipToken, context)); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotRecommendationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotRecommendationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotRecommendationId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), apiVersion, scope, iotRecommendationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String iotRecommendationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotRecommendationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotRecommendationId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, iotRecommendationId, accept, context); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String iotRecommendationId) { - return getWithResponseAsync(scope, iotRecommendationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotRecommendationModelInner get(String scope, String iotRecommendationId) { - return getAsync(scope, iotRecommendationId).block(); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scope, String iotRecommendationId, Context context) { - return getWithResponseAsync(scope, iotRecommendationId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsImpl.java deleted file mode 100644 index 838a95d63689..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.azure.resourcemanager.security.models.IotRecommendationModel; -import com.azure.resourcemanager.security.models.IotRecommendations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotRecommendationsImpl implements IotRecommendations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationsImpl.class); - - private final IotRecommendationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotRecommendationsImpl( - IotRecommendationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new IotRecommendationModelImpl(inner1, this.manager())); - } - - public PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().list(scope, recommendationType, deviceId, limit, skipToken, context); - return Utils.mapPage(inner, inner1 -> new IotRecommendationModelImpl(inner1, this.manager())); - } - - public IotRecommendationModel get(String scope, String iotRecommendationId) { - IotRecommendationModelInner inner = this.serviceClient().get(scope, iotRecommendationId); - if (inner != null) { - return new IotRecommendationModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, String iotRecommendationId, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, iotRecommendationId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotRecommendationModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotRecommendationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java deleted file mode 100644 index edde9f94c091..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java +++ /dev/null @@ -1,1026 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotSensorsClient. */ -public final class IotSensorsClientImpl implements IotSensorsClient { - private final ClientLogger logger = new ClientLogger(IotSensorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotSensorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSensorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSensorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotSensorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSensors to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSen") - private interface IotSensorsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSensors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @BodyParam("application/json") IotSensorsModelInner iotSensorsModel, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadActivation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadResetPassword( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @BodyParam("application/json") ResetPasswordInput body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> triggerTiPackageUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scope) { - return listWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSensorsListInner list(String scope) { - return listAsync(scope).block(); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scope, Context context) { - return listWithResponseAsync(scope, context).block(); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String iotSensorName) { - return getWithResponseAsync(scope, iotSensorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSensorsModelInner get(String scope, String iotSensorName) { - return getAsync(scope, iotSensorName).block(); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String iotSensorName, Context context) { - return getWithResponseAsync(scope, iotSensorName, context).block(); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (iotSensorsModel == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotSensorsModel is required and cannot be null.")); - } else { - iotSensorsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - iotSensorName, - iotSensorsModel, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (iotSensorsModel == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotSensorsModel is required and cannot be null.")); - } else { - iotSensorsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, iotSensorsModel, accept, context); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel) { - return createOrUpdateWithResponseAsync(scope, iotSensorName, iotSensorsModel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSensorsModelInner createOrUpdate( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel) { - return createOrUpdateAsync(scope, iotSensorName, iotSensorsModel).block(); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel, Context context) { - return createOrUpdateWithResponseAsync(scope, iotSensorName, iotSensorsModel, context).block(); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String iotSensorName) { - return deleteWithResponseAsync(scope, iotSensorName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String iotSensorName) { - deleteAsync(scope, iotSensorName).block(); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String iotSensorName, Context context) { - return deleteWithResponseAsync(scope, iotSensorName, context).block(); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadActivation( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync( - String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service.downloadActivation(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadActivationAsync(String scope, String iotSensorName) { - return downloadActivationWithResponseAsync(scope, iotSensorName).flatMapMany(StreamResponse::getValue); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadActivation(String scope, String iotSensorName) { - Iterator iterator = - downloadActivationAsync(scope, iotSensorName).map(ByteBufferBackedInputStream::new).toStream().iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context) { - return downloadActivationWithResponseAsync(scope, iotSensorName, context).block(); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String scope, String iotSensorName, ResetPasswordInput body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadResetPassword( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String scope, String iotSensorName, ResetPasswordInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadResetPassword(this.client.getEndpoint(), apiVersion, scope, iotSensorName, body, accept, context); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadResetPasswordAsync(String scope, String iotSensorName, ResetPasswordInput body) { - return downloadResetPasswordWithResponseAsync(scope, iotSensorName, body).flatMapMany(StreamResponse::getValue); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body) { - Iterator iterator = - downloadResetPasswordAsync(scope, iotSensorName, body) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context) { - return downloadResetPasswordWithResponseAsync(scope, iotSensorName, body, context).block(); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> triggerTiPackageUpdateWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .triggerTiPackageUpdate( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> triggerTiPackageUpdateWithResponseAsync( - String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .triggerTiPackageUpdate(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerTiPackageUpdateAsync(String scope, String iotSensorName) { - return triggerTiPackageUpdateWithResponseAsync(scope, iotSensorName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void triggerTiPackageUpdate(String scope, String iotSensorName) { - triggerTiPackageUpdateAsync(scope, iotSensorName).block(); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context) { - return triggerTiPackageUpdateWithResponseAsync(scope, iotSensorName, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java deleted file mode 100644 index 73997c7903a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.IotSensors; -import com.azure.resourcemanager.security.models.IotSensorsList; -import com.azure.resourcemanager.security.models.IotSensorsModel; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.io.InputStream; - -public final class IotSensorsImpl implements IotSensors { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSensorsImpl.class); - - private final IotSensorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSensorsImpl( - IotSensorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotSensorsList list(String scope) { - IotSensorsListInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new IotSensorsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String scope, Context context) { - Response inner = this.serviceClient().listWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSensorsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotSensorsModel get(String scope, String iotSensorName) { - IotSensorsModelInner inner = this.serviceClient().get(scope, iotSensorName); - if (inner != null) { - return new IotSensorsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, String iotSensorName, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, iotSensorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSensorsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String scope, String iotSensorName) { - this.serviceClient().delete(scope, iotSensorName); - } - - public Response deleteWithResponse(String scope, String iotSensorName, Context context) { - return this.serviceClient().deleteWithResponse(scope, iotSensorName, context); - } - - public InputStream downloadActivation(String scope, String iotSensorName) { - return this.serviceClient().downloadActivation(scope, iotSensorName); - } - - public StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context) { - return this.serviceClient().downloadActivationWithResponse(scope, iotSensorName, context); - } - - public InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body) { - return this.serviceClient().downloadResetPassword(scope, iotSensorName, body); - } - - public StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context) { - return this.serviceClient().downloadResetPasswordWithResponse(scope, iotSensorName, body, context); - } - - public void triggerTiPackageUpdate(String scope, String iotSensorName) { - this.serviceClient().triggerTiPackageUpdate(scope, iotSensorName); - } - - public Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context) { - return this.serviceClient().triggerTiPackageUpdateWithResponse(scope, iotSensorName, context); - } - - public IotSensorsModel getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - return this.getWithResponse(scope, iotSensorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - return this.getWithResponse(scope, iotSensorName, context); - } - - public void deleteById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - this.deleteWithResponse(scope, iotSensorName, Context.NONE).getValue(); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - return this.deleteWithResponse(scope, iotSensorName, context); - } - - private IotSensorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IotSensorsModelImpl define(String name) { - return new IotSensorsModelImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.java deleted file mode 100644 index dffae09845d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.IotSensorsList; -import com.azure.resourcemanager.security.models.IotSensorsModel; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotSensorsListImpl implements IotSensorsList { - private IotSensorsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotSensorsListImpl( - IotSensorsListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new IotSensorsModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotSensorsListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsModelImpl.java deleted file mode 100644 index 75cbf9d345a2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsModelImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.IotSensorsModel; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.azure.resourcemanager.security.models.SensorStatus; -import com.azure.resourcemanager.security.models.SensorType; -import com.azure.resourcemanager.security.models.TiStatus; -import java.io.InputStream; - -public final class IotSensorsModelImpl implements IotSensorsModel, IotSensorsModel.Definition, IotSensorsModel.Update { - private IotSensorsModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String connectivityTime() { - return this.innerModel().connectivityTime(); - } - - public String creationTime() { - return this.innerModel().creationTime(); - } - - public Boolean dynamicLearning() { - return this.innerModel().dynamicLearning(); - } - - public Boolean learningMode() { - return this.innerModel().learningMode(); - } - - public SensorStatus sensorStatus() { - return this.innerModel().sensorStatus(); - } - - public String sensorVersion() { - return this.innerModel().sensorVersion(); - } - - public Boolean tiAutomaticUpdates() { - return this.innerModel().tiAutomaticUpdates(); - } - - public TiStatus tiStatus() { - return this.innerModel().tiStatus(); - } - - public String tiVersion() { - return this.innerModel().tiVersion(); - } - - public String zone() { - return this.innerModel().zone(); - } - - public SensorType sensorType() { - return this.innerModel().sensorType(); - } - - public IotSensorsModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String iotSensorName; - - public IotSensorsModelImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public IotSensorsModel create() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IotSensorsModel create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), context) - .getValue(); - return this; - } - - IotSensorsModelImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IotSensorsModelInner(); - this.serviceManager = serviceManager; - this.iotSensorName = name; - } - - public IotSensorsModelImpl update() { - return this; - } - - public IotSensorsModel apply() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IotSensorsModel apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), context) - .getValue(); - return this; - } - - IotSensorsModelImpl( - IotSensorsModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - this.iotSensorName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", - "iotSensorName"); - } - - public IotSensorsModel refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .getWithResponse(scope, iotSensorName, Context.NONE) - .getValue(); - return this; - } - - public IotSensorsModel refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getIotSensors().getWithResponse(scope, iotSensorName, context).getValue(); - return this; - } - - public InputStream downloadActivation() { - return serviceManager.iotSensors().downloadActivation(scope, iotSensorName); - } - - public StreamResponse downloadActivationWithResponse(Context context) { - return serviceManager.iotSensors().downloadActivationWithResponse(scope, iotSensorName, context); - } - - public InputStream downloadResetPassword(ResetPasswordInput body) { - return serviceManager.iotSensors().downloadResetPassword(scope, iotSensorName, body); - } - - public StreamResponse downloadResetPasswordWithResponse(ResetPasswordInput body, Context context) { - return serviceManager.iotSensors().downloadResetPasswordWithResponse(scope, iotSensorName, body, context); - } - - public void triggerTiPackageUpdate() { - serviceManager.iotSensors().triggerTiPackageUpdate(scope, iotSensorName); - } - - public Response triggerTiPackageUpdateWithResponse(Context context) { - return serviceManager.iotSensors().triggerTiPackageUpdateWithResponse(scope, iotSensorName, context); - } - - public IotSensorsModelImpl withTiAutomaticUpdates(Boolean tiAutomaticUpdates) { - this.innerModel().withTiAutomaticUpdates(tiAutomaticUpdates); - return this; - } - - public IotSensorsModelImpl withZone(String zone) { - this.innerModel().withZone(zone); - return this; - } - - public IotSensorsModelImpl withSensorType(SensorType sensorType) { - this.innerModel().withSensorType(sensorType); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java deleted file mode 100644 index 47c040539e41..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java +++ /dev/null @@ -1,537 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSitesClient; -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotSitesClient. */ -public final class IotSitesClientImpl implements IotSitesClient { - private final ClientLogger logger = new ClientLogger(IotSitesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotSitesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSitesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSitesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(IotSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSites to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSit") - private interface IotSitesService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSites/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/iotSites/default") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @BodyParam("application/json") IotSitesModelInner iotSitesModel, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Security/iotSites/default") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scope) { - return listWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSitesListInner list(String scope) { - return listAsync(scope).block(); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scope, Context context) { - return listWithResponseAsync(scope, context).block(); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope) { - return getWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSitesModelInner get(String scope) { - return getAsync(scope).block(); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, Context context) { - return getWithResponseAsync(scope, context).block(); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, IotSitesModelInner iotSitesModel) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSitesModel == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSitesModel is required and cannot be null.")); - } else { - iotSitesModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate(this.client.getEndpoint(), apiVersion, scope, iotSitesModel, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, IotSitesModelInner iotSitesModel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSitesModel == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSitesModel is required and cannot be null.")); - } else { - iotSitesModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, iotSitesModel, accept, context); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, IotSitesModelInner iotSitesModel) { - return createOrUpdateWithResponseAsync(scope, iotSitesModel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSitesModelInner createOrUpdate(String scope, IotSitesModelInner iotSitesModel) { - return createOrUpdateAsync(scope, iotSitesModel).block(); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, IotSitesModelInner iotSitesModel, Context context) { - return createOrUpdateWithResponseAsync(scope, iotSitesModel, context).block(); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope) { - return deleteWithResponseAsync(scope).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope) { - deleteAsync(scope).block(); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, Context context) { - return deleteWithResponseAsync(scope, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java deleted file mode 100644 index 4b705e75ad66..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSitesClient; -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import com.azure.resourcemanager.security.models.IotSites; -import com.azure.resourcemanager.security.models.IotSitesList; -import com.azure.resourcemanager.security.models.IotSitesModel; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotSitesImpl implements IotSites { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSitesImpl.class); - - private final IotSitesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSitesImpl(IotSitesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotSitesList list(String scope) { - IotSitesListInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new IotSitesListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String scope, Context context) { - Response inner = this.serviceClient().listWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSitesListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotSitesModel get(String scope) { - IotSitesModelInner inner = this.serviceClient().get(scope); - if (inner != null) { - return new IotSitesModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSitesModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotSitesModel createOrUpdate(String scope, IotSitesModelInner iotSitesModel) { - IotSitesModelInner inner = this.serviceClient().createOrUpdate(scope, iotSitesModel); - if (inner != null) { - return new IotSitesModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String scope, IotSitesModelInner iotSitesModel, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(scope, iotSitesModel, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSitesModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String scope) { - this.serviceClient().delete(scope); - } - - public Response deleteWithResponse(String scope, Context context) { - return this.serviceClient().deleteWithResponse(scope, context); - } - - private IotSitesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesListImpl.java deleted file mode 100644 index a4c09713ae5f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesListImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import com.azure.resourcemanager.security.models.IotSitesList; -import com.azure.resourcemanager.security.models.IotSitesModel; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotSitesListImpl implements IotSitesList { - private IotSitesListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotSitesListImpl(IotSitesListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new IotSitesModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotSitesListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesModelImpl.java deleted file mode 100644 index 93d7305087cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesModelImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import com.azure.resourcemanager.security.models.IotSitesModel; -import java.util.Collections; -import java.util.Map; - -public final class IotSitesModelImpl implements IotSitesModel { - private IotSitesModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotSitesModelImpl( - IotSitesModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public IotSitesModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorImpl.java deleted file mode 100644 index 0e90e7e569cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorImpl.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.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.models.OnPremiseIotSensor; - -public final class OnPremiseIotSensorImpl implements OnPremiseIotSensor { - private OnPremiseIotSensorInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OnPremiseIotSensorImpl( - OnPremiseIotSensorInner 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 OnPremiseIotSensorInner 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/OnPremiseIotSensorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsClientImpl.java deleted file mode 100644 index baab7b119bdb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsClientImpl.java +++ /dev/null @@ -1,971 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.OnPremiseIotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OnPremiseIotSensorsClient. */ -public final class OnPremiseIotSensorsClientImpl implements OnPremiseIotSensorsClient { - private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OnPremiseIotSensorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OnPremiseIotSensorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OnPremiseIotSensorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(OnPremiseIotSensorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOnPremiseIotSensors to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterOnPrem") - private interface OnPremiseIotSensorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}" - + "/downloadActivation") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadActivation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}" - + "/downloadResetPassword") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadResetPassword( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @BodyParam("application/json") ResetPasswordInput body, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List on-premise IoT sensors. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List on-premise IoT sensors. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List on-premise IoT sensors. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List on-premise IoT sensors. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OnPremiseIotSensorsListInner list() { - return listAsync().block(); - } - - /** - * List on-premise IoT sensors. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String onPremiseIotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String onPremiseIotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String onPremiseIotSensorName) { - return getWithResponseAsync(onPremiseIotSensorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OnPremiseIotSensorInner get(String onPremiseIotSensorName) { - return getAsync(onPremiseIotSensorName).block(); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String onPremiseIotSensorName, Context context) { - return getWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String onPremiseIotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String onPremiseIotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String onPremiseIotSensorName) { - return createOrUpdateWithResponseAsync(onPremiseIotSensorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OnPremiseIotSensorInner createOrUpdate(String onPremiseIotSensorName) { - return createOrUpdateAsync(onPremiseIotSensorName).block(); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String onPremiseIotSensorName, Context context) { - return createOrUpdateWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String onPremiseIotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String onPremiseIotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String onPremiseIotSensorName) { - return deleteWithResponseAsync(onPremiseIotSensorName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String onPremiseIotSensorName) { - deleteAsync(onPremiseIotSensorName).block(); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String onPremiseIotSensorName, Context context) { - return deleteWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync(String onPremiseIotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadActivation( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync(String onPremiseIotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadActivation( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadActivationAsync(String onPremiseIotSensorName) { - return downloadActivationWithResponseAsync(onPremiseIotSensorName).flatMapMany(StreamResponse::getValue); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadActivation(String onPremiseIotSensorName) { - Iterator iterator = - downloadActivationAsync(onPremiseIotSensorName).map(ByteBufferBackedInputStream::new).toStream().iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context) { - return downloadActivationWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String onPremiseIotSensorName, ResetPasswordInput body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadResetPassword( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String onPremiseIotSensorName, ResetPasswordInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadResetPassword( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - body, - accept, - context); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadResetPasswordAsync(String onPremiseIotSensorName, ResetPasswordInput body) { - return downloadResetPasswordWithResponseAsync(onPremiseIotSensorName, body) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body) { - Iterator iterator = - downloadResetPasswordAsync(onPremiseIotSensorName, body) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context) { - return downloadResetPasswordWithResponseAsync(onPremiseIotSensorName, body, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.java deleted file mode 100644 index 74df09ca6ff5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.OnPremiseIotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.OnPremiseIotSensor; -import com.azure.resourcemanager.security.models.OnPremiseIotSensors; -import com.azure.resourcemanager.security.models.OnPremiseIotSensorsList; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.io.InputStream; - -public final class OnPremiseIotSensorsImpl implements OnPremiseIotSensors { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorsImpl.class); - - private final OnPremiseIotSensorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OnPremiseIotSensorsImpl( - OnPremiseIotSensorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public OnPremiseIotSensorsList list() { - OnPremiseIotSensorsListInner inner = this.serviceClient().list(); - if (inner != null) { - return new OnPremiseIotSensorsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OnPremiseIotSensorsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OnPremiseIotSensor get(String onPremiseIotSensorName) { - OnPremiseIotSensorInner inner = this.serviceClient().get(onPremiseIotSensorName); - if (inner != null) { - return new OnPremiseIotSensorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String onPremiseIotSensorName, Context context) { - Response inner = this.serviceClient().getWithResponse(onPremiseIotSensorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OnPremiseIotSensorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OnPremiseIotSensor createOrUpdate(String onPremiseIotSensorName) { - OnPremiseIotSensorInner inner = this.serviceClient().createOrUpdate(onPremiseIotSensorName); - if (inner != null) { - return new OnPremiseIotSensorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String onPremiseIotSensorName, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(onPremiseIotSensorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OnPremiseIotSensorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String onPremiseIotSensorName) { - this.serviceClient().delete(onPremiseIotSensorName); - } - - public Response deleteWithResponse(String onPremiseIotSensorName, Context context) { - return this.serviceClient().deleteWithResponse(onPremiseIotSensorName, context); - } - - public InputStream downloadActivation(String onPremiseIotSensorName) { - return this.serviceClient().downloadActivation(onPremiseIotSensorName); - } - - public StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context) { - return this.serviceClient().downloadActivationWithResponse(onPremiseIotSensorName, context); - } - - public InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body) { - return this.serviceClient().downloadResetPassword(onPremiseIotSensorName, body); - } - - public StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context) { - return this.serviceClient().downloadResetPasswordWithResponse(onPremiseIotSensorName, body, context); - } - - private OnPremiseIotSensorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsListImpl.java deleted file mode 100644 index 2a4b774c145c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsListImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.OnPremiseIotSensor; -import com.azure.resourcemanager.security.models.OnPremiseIotSensorsList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class OnPremiseIotSensorsListImpl implements OnPremiseIotSensorsList { - private OnPremiseIotSensorsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OnPremiseIotSensorsListImpl( - OnPremiseIotSensorsListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new OnPremiseIotSensorImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public OnPremiseIotSensorsListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java index 5609a7a475ca..46f54a6c241c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java @@ -85,7 +85,7 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +118,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -149,7 +149,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -163,7 +163,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -176,7 +176,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -190,7 +190,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -204,7 +204,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -240,7 +240,7 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.java deleted file mode 100644 index 41263da35fe8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import com.azure.resourcemanager.security.models.PackageDownloadInfo; -import com.azure.resourcemanager.security.models.PackageDownloads; -import com.azure.resourcemanager.security.models.PackageDownloadsCentralManager; -import com.azure.resourcemanager.security.models.PackageDownloadsSensor; -import java.util.Collections; -import java.util.List; - -public final class PackageDownloadsImpl implements PackageDownloads { - private PackageDownloadsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PackageDownloadsImpl( - PackageDownloadsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public PackageDownloadsSensor sensor() { - return this.innerModel().sensor(); - } - - public PackageDownloadsCentralManager centralManager() { - return this.innerModel().centralManager(); - } - - public List threatIntelligence() { - List inner = this.innerModel().threatIntelligence(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List snmp() { - List inner = this.innerModel().snmp(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List wmiTool() { - List inner = this.innerModel().wmiTool(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List authorizedDevicesImportTemplate() { - List inner = this.innerModel().authorizedDevicesImportTemplate(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List deviceInformationUpdateImportTemplate() { - List inner = this.innerModel().deviceInformationUpdateImportTemplate(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PackageDownloadsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java similarity index 58% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java index bec0aedd291b..350f1242f731 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java @@ -5,26 +5,29 @@ package com.azure.resourcemanager.security.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import com.azure.resourcemanager.security.models.AssessmentType; import com.azure.resourcemanager.security.models.Categories; import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadata; import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Tactics; +import com.azure.resourcemanager.security.models.Techniques; import com.azure.resourcemanager.security.models.Threats; import com.azure.resourcemanager.security.models.UserImpact; import java.util.Collections; import java.util.List; -public final class SecurityAssessmentMetadataImpl - implements SecurityAssessmentMetadata, SecurityAssessmentMetadata.Definition { - private SecurityAssessmentMetadataInner innerObject; +public final class SecurityAssessmentMetadataResponseImpl + implements SecurityAssessmentMetadataResponse, SecurityAssessmentMetadataResponse.Definition { + private SecurityAssessmentMetadataResponseInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecurityAssessmentMetadataImpl( - SecurityAssessmentMetadataInner innerObject, + SecurityAssessmentMetadataResponseImpl( + SecurityAssessmentMetadataResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -100,7 +103,33 @@ public SecurityAssessmentMetadataPartnerData partnerData() { return this.innerModel().partnerData(); } - public SecurityAssessmentMetadataInner innerModel() { + public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { + return this.innerModel().publishDates(); + } + + public String plannedDeprecationDate() { + return this.innerModel().plannedDeprecationDate(); + } + + public List tactics() { + List inner = this.innerModel().tactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List techniques() { + List inner = this.innerModel().techniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityAssessmentMetadataResponseInner innerModel() { return this.innerObject; } @@ -110,7 +139,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String assessmentMetadataName; - public SecurityAssessmentMetadata create() { + public SecurityAssessmentMetadataResponse create() { this.innerObject = serviceManager .serviceClient() @@ -120,7 +149,7 @@ public SecurityAssessmentMetadata create() { return this; } - public SecurityAssessmentMetadata create(Context context) { + public SecurityAssessmentMetadataResponse create(Context context) { this.innerObject = serviceManager .serviceClient() @@ -130,13 +159,14 @@ public SecurityAssessmentMetadata create(Context context) { return this; } - SecurityAssessmentMetadataImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentMetadataInner(); + SecurityAssessmentMetadataResponseImpl( + String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new SecurityAssessmentMetadataResponseInner(); this.serviceManager = serviceManager; this.assessmentMetadataName = name; } - public SecurityAssessmentMetadata refresh() { + public SecurityAssessmentMetadataResponse refresh() { this.innerObject = serviceManager .serviceClient() @@ -146,7 +176,7 @@ public SecurityAssessmentMetadata refresh() { return this; } - public SecurityAssessmentMetadata refresh(Context context) { + public SecurityAssessmentMetadataResponse refresh(Context context) { this.innerObject = serviceManager .serviceClient() @@ -156,58 +186,79 @@ public SecurityAssessmentMetadata refresh(Context context) { return this; } - public SecurityAssessmentMetadataImpl withDisplayName(String displayName) { + public SecurityAssessmentMetadataResponseImpl withDisplayName(String displayName) { this.innerModel().withDisplayName(displayName); return this; } - public SecurityAssessmentMetadataImpl withDescription(String description) { + public SecurityAssessmentMetadataResponseImpl withDescription(String description) { this.innerModel().withDescription(description); return this; } - public SecurityAssessmentMetadataImpl withRemediationDescription(String remediationDescription) { + public SecurityAssessmentMetadataResponseImpl withRemediationDescription(String remediationDescription) { this.innerModel().withRemediationDescription(remediationDescription); return this; } - public SecurityAssessmentMetadataImpl withCategories(List categories) { + public SecurityAssessmentMetadataResponseImpl withCategories(List categories) { this.innerModel().withCategories(categories); return this; } - public SecurityAssessmentMetadataImpl withSeverity(Severity severity) { + public SecurityAssessmentMetadataResponseImpl withSeverity(Severity severity) { this.innerModel().withSeverity(severity); return this; } - public SecurityAssessmentMetadataImpl withUserImpact(UserImpact userImpact) { + public SecurityAssessmentMetadataResponseImpl withUserImpact(UserImpact userImpact) { this.innerModel().withUserImpact(userImpact); return this; } - public SecurityAssessmentMetadataImpl withImplementationEffort(ImplementationEffort implementationEffort) { + public SecurityAssessmentMetadataResponseImpl withImplementationEffort(ImplementationEffort implementationEffort) { this.innerModel().withImplementationEffort(implementationEffort); return this; } - public SecurityAssessmentMetadataImpl withThreats(List threats) { + public SecurityAssessmentMetadataResponseImpl withThreats(List threats) { this.innerModel().withThreats(threats); return this; } - public SecurityAssessmentMetadataImpl withPreview(Boolean preview) { + public SecurityAssessmentMetadataResponseImpl withPreview(Boolean preview) { this.innerModel().withPreview(preview); return this; } - public SecurityAssessmentMetadataImpl withAssessmentType(AssessmentType assessmentType) { + public SecurityAssessmentMetadataResponseImpl withAssessmentType(AssessmentType assessmentType) { this.innerModel().withAssessmentType(assessmentType); return this; } - public SecurityAssessmentMetadataImpl withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { + public SecurityAssessmentMetadataResponseImpl withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { this.innerModel().withPartnerData(partnerData); return this; } + + public SecurityAssessmentMetadataResponseImpl withPublishDates( + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + this.innerModel().withPublishDates(publishDates); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withPlannedDeprecationDate(String plannedDeprecationDate) { + this.innerModel().withPlannedDeprecationDate(plannedDeprecationDate); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withTactics(List tactics) { + this.innerModel().withTactics(tactics); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withTechniques(List techniques) { + this.innerModel().withTechniques(techniques); + return this; + } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java similarity index 57% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java index bccc29197d91..ea2680ab17cd 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java @@ -5,20 +5,22 @@ package com.azure.resourcemanager.security.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.AssessmentLinks; import com.azure.resourcemanager.security.models.AssessmentStatus; +import com.azure.resourcemanager.security.models.AssessmentStatusResponse; import com.azure.resourcemanager.security.models.ExpandEnum; import com.azure.resourcemanager.security.models.ResourceDetails; import com.azure.resourcemanager.security.models.SecurityAssessment; import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; import java.util.Collections; import java.util.Map; -public final class SecurityAssessmentImpl - implements SecurityAssessment, SecurityAssessment.Definition, SecurityAssessment.Update { - private SecurityAssessmentInner innerObject; +public final class SecurityAssessmentResponseImpl + implements SecurityAssessmentResponse, SecurityAssessmentResponse.Definition, SecurityAssessmentResponse.Update { + private SecurityAssessmentResponseInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; @@ -42,10 +44,6 @@ public String displayName() { return this.innerModel().displayName(); } - public AssessmentStatus status() { - return this.innerModel().status(); - } - public Map additionalData() { Map inner = this.innerModel().additionalData(); if (inner != null) { @@ -67,7 +65,11 @@ public SecurityAssessmentPartnerData partnersData() { return this.innerModel().partnersData(); } - public SecurityAssessmentInner innerModel() { + public AssessmentStatusResponse status() { + return this.innerModel().status(); + } + + public SecurityAssessmentResponseInner innerModel() { return this.innerObject; } @@ -79,63 +81,70 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String assessmentName; - public SecurityAssessmentImpl withExistingResourceId(String resourceId) { + private SecurityAssessment createAssessment; + + private SecurityAssessment updateAssessment; + + public SecurityAssessmentResponseImpl withExistingResourceId(String resourceId) { this.resourceId = resourceId; return this; } - public SecurityAssessment create() { + public SecurityAssessmentResponse create() { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), Context.NONE) + .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, Context.NONE) .getValue(); return this; } - public SecurityAssessment create(Context context) { + public SecurityAssessmentResponse create(Context context) { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), context) + .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, context) .getValue(); return this; } - SecurityAssessmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentInner(); + SecurityAssessmentResponseImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new SecurityAssessmentResponseInner(); this.serviceManager = serviceManager; this.assessmentName = name; + this.createAssessment = new SecurityAssessment(); } - public SecurityAssessmentImpl update() { + public SecurityAssessmentResponseImpl update() { + this.updateAssessment = new SecurityAssessment(); return this; } - public SecurityAssessment apply() { + public SecurityAssessmentResponse apply() { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), Context.NONE) + .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, Context.NONE) .getValue(); return this; } - public SecurityAssessment apply(Context context) { + public SecurityAssessmentResponse apply(Context context) { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), context) + .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, context) .getValue(); return this; } - SecurityAssessmentImpl( - SecurityAssessmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecurityAssessmentResponseImpl( + SecurityAssessmentResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceId = @@ -152,7 +161,7 @@ public SecurityAssessment apply(Context context) { "assessmentName"); } - public SecurityAssessment refresh() { + public SecurityAssessmentResponse refresh() { ExpandEnum localExpand = null; this.innerObject = serviceManager @@ -163,7 +172,7 @@ public SecurityAssessment refresh() { return this; } - public SecurityAssessment refresh(Context context) { + public SecurityAssessmentResponse refresh(Context context) { ExpandEnum localExpand = null; this.innerObject = serviceManager @@ -174,28 +183,57 @@ public SecurityAssessment refresh(Context context) { return this; } - public SecurityAssessmentImpl withResourceDetails(ResourceDetails resourceDetails) { - this.innerModel().withResourceDetails(resourceDetails); - return this; + public SecurityAssessmentResponseImpl withResourceDetails(ResourceDetails resourceDetails) { + if (isInCreateMode()) { + this.createAssessment.withResourceDetails(resourceDetails); + return this; + } else { + this.updateAssessment.withResourceDetails(resourceDetails); + return this; + } } - public SecurityAssessmentImpl withStatus(AssessmentStatus status) { - this.innerModel().withStatus(status); - return this; + public SecurityAssessmentResponseImpl withAdditionalData(Map additionalData) { + if (isInCreateMode()) { + this.createAssessment.withAdditionalData(additionalData); + return this; + } else { + this.updateAssessment.withAdditionalData(additionalData); + return this; + } } - public SecurityAssessmentImpl withAdditionalData(Map additionalData) { - this.innerModel().withAdditionalData(additionalData); - return this; + public SecurityAssessmentResponseImpl withMetadata(SecurityAssessmentMetadataProperties metadata) { + if (isInCreateMode()) { + this.createAssessment.withMetadata(metadata); + return this; + } else { + this.updateAssessment.withMetadata(metadata); + return this; + } } - public SecurityAssessmentImpl withMetadata(SecurityAssessmentMetadataProperties metadata) { - this.innerModel().withMetadata(metadata); - return this; + public SecurityAssessmentResponseImpl withPartnersData(SecurityAssessmentPartnerData partnersData) { + if (isInCreateMode()) { + this.createAssessment.withPartnersData(partnersData); + return this; + } else { + this.updateAssessment.withPartnersData(partnersData); + return this; + } } - public SecurityAssessmentImpl withPartnersData(SecurityAssessmentPartnerData partnersData) { - this.innerModel().withPartnersData(partnersData); - return this; + public SecurityAssessmentResponseImpl withStatus(AssessmentStatus status) { + if (isInCreateMode()) { + this.createAssessment.withStatus(status); + return this; + } else { + this.updateAssessment.withStatus(status); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java index 7501c30676cf..307a20af3915 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java @@ -34,28 +34,18 @@ 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.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.DevicesClient; -import com.azure.resourcemanager.security.fluent.DevicesForHubsClient; -import com.azure.resourcemanager.security.fluent.DevicesForSubscriptionsClient; import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.IotAlertTypesClient; -import com.azure.resourcemanager.security.fluent.IotAlertsClient; -import com.azure.resourcemanager.security.fluent.IotDefenderSettingsClient; -import com.azure.resourcemanager.security.fluent.IotRecommendationTypesClient; -import com.azure.resourcemanager.security.fluent.IotRecommendationsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.IotSensorsClient; -import com.azure.resourcemanager.security.fluent.IotSitesClient; import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.OnPremiseIotSensorsClient; import com.azure.resourcemanager.security.fluent.OperationsClient; import com.azure.resourcemanager.security.fluent.PricingsClient; import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; @@ -153,6 +143,18 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** 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 ComplianceResultsClient object to access its operations. */ private final ComplianceResultsClient complianceResults; @@ -645,138 +647,6 @@ public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessme return this.sqlVulnerabilityAssessmentBaselineRules; } - /** The IotDefenderSettingsClient object to access its operations. */ - private final IotDefenderSettingsClient iotDefenderSettings; - - /** - * Gets the IotDefenderSettingsClient object to access its operations. - * - * @return the IotDefenderSettingsClient object. - */ - public IotDefenderSettingsClient getIotDefenderSettings() { - return this.iotDefenderSettings; - } - - /** The IotSensorsClient object to access its operations. */ - private final IotSensorsClient iotSensors; - - /** - * Gets the IotSensorsClient object to access its operations. - * - * @return the IotSensorsClient object. - */ - public IotSensorsClient getIotSensors() { - return this.iotSensors; - } - - /** The DevicesForSubscriptionsClient object to access its operations. */ - private final DevicesForSubscriptionsClient devicesForSubscriptions; - - /** - * Gets the DevicesForSubscriptionsClient object to access its operations. - * - * @return the DevicesForSubscriptionsClient object. - */ - public DevicesForSubscriptionsClient getDevicesForSubscriptions() { - return this.devicesForSubscriptions; - } - - /** The DevicesForHubsClient object to access its operations. */ - private final DevicesForHubsClient devicesForHubs; - - /** - * Gets the DevicesForHubsClient object to access its operations. - * - * @return the DevicesForHubsClient object. - */ - public DevicesForHubsClient getDevicesForHubs() { - return this.devicesForHubs; - } - - /** The DevicesClient object to access its operations. */ - private final DevicesClient devices; - - /** - * Gets the DevicesClient object to access its operations. - * - * @return the DevicesClient object. - */ - public DevicesClient getDevices() { - return this.devices; - } - - /** The OnPremiseIotSensorsClient object to access its operations. */ - private final OnPremiseIotSensorsClient onPremiseIotSensors; - - /** - * Gets the OnPremiseIotSensorsClient object to access its operations. - * - * @return the OnPremiseIotSensorsClient object. - */ - public OnPremiseIotSensorsClient getOnPremiseIotSensors() { - return this.onPremiseIotSensors; - } - - /** The IotSitesClient object to access its operations. */ - private final IotSitesClient iotSites; - - /** - * Gets the IotSitesClient object to access its operations. - * - * @return the IotSitesClient object. - */ - public IotSitesClient getIotSites() { - return this.iotSites; - } - - /** The IotAlertsClient object to access its operations. */ - private final IotAlertsClient iotAlerts; - - /** - * Gets the IotAlertsClient object to access its operations. - * - * @return the IotAlertsClient object. - */ - public IotAlertsClient getIotAlerts() { - return this.iotAlerts; - } - - /** The IotAlertTypesClient object to access its operations. */ - private final IotAlertTypesClient iotAlertTypes; - - /** - * Gets the IotAlertTypesClient object to access its operations. - * - * @return the IotAlertTypesClient object. - */ - public IotAlertTypesClient getIotAlertTypes() { - return this.iotAlertTypes; - } - - /** The IotRecommendationsClient object to access its operations. */ - private final IotRecommendationsClient iotRecommendations; - - /** - * Gets the IotRecommendationsClient object to access its operations. - * - * @return the IotRecommendationsClient object. - */ - public IotRecommendationsClient getIotRecommendations() { - return this.iotRecommendations; - } - - /** The IotRecommendationTypesClient object to access its operations. */ - private final IotRecommendationTypesClient iotRecommendationTypes; - - /** - * Gets the IotRecommendationTypesClient object to access its operations. - * - * @return the IotRecommendationTypesClient object. - */ - public IotRecommendationTypesClient getIotRecommendationTypes() { - return this.iotRecommendationTypes; - } - /** The AlertsClient object to access its operations. */ private final AlertsClient alerts; @@ -847,6 +717,7 @@ public SoftwareInventoriesClient getSoftwareInventories() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.customAssessmentAutomations = new CustomAssessmentAutomationsClientImpl(this); this.complianceResults = new ComplianceResultsClientImpl(this); this.pricings = new PricingsClientImpl(this); this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); @@ -890,17 +761,6 @@ public SoftwareInventoriesClient getSoftwareInventories() { this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.iotDefenderSettings = new IotDefenderSettingsClientImpl(this); - this.iotSensors = new IotSensorsClientImpl(this); - this.devicesForSubscriptions = new DevicesForSubscriptionsClientImpl(this); - this.devicesForHubs = new DevicesForHubsClientImpl(this); - this.devices = new DevicesClientImpl(this); - this.onPremiseIotSensors = new OnPremiseIotSensorsClientImpl(this); - this.iotSites = new IotSitesClientImpl(this); - this.iotAlerts = new IotAlertsClientImpl(this); - this.iotAlertTypes = new IotAlertTypesClientImpl(this); - this.iotRecommendations = new IotRecommendationsClientImpl(this); - this.iotRecommendationTypes = new IotRecommendationTypesClientImpl(this); this.alerts = new AlertsClientImpl(this); this.settings = new SettingsClientImpl(this); this.ingestionSettings = new IngestionSettingsClientImpl(this); 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 03354fdad88f..af6c5969124c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java @@ -129,7 +129,7 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -171,7 +171,7 @@ private Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -266,7 +266,7 @@ private Mono> getWithResponseAsync(SettingsSettingName se if (settingName == null) { return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -309,7 +309,7 @@ private Mono> getWithResponseAsync(SettingsSettingName se if (settingName == null) { return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -400,7 +400,7 @@ private Mono> updateWithResponseAsync( } else { setting.validate(); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -451,7 +451,7 @@ private Mono> updateWithResponseAsync( } else { setting.validate(); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java index f1fede6bde7d..85145a61c2b9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java @@ -4,47 +4,34 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; -/** Describes an Azure resource with kind. */ -@Fluent -public class AadConnectivityState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AadConnectivityState.class); +/** Defines values for AadConnectivityState. */ +public final class AadConnectivityState extends ExpandableStringEnum { + /** Static value Discovered for AadConnectivityState. */ + public static final AadConnectivityState DISCOVERED = fromString("Discovered"); - /* - * The connectivity state of the external AAD solution - */ - @JsonProperty(value = "connectivityState") - private AadConnectivityStateValue connectivityState; + /** Static value NotLicensed for AadConnectivityState. */ + public static final AadConnectivityState NOT_LICENSED = fromString("NotLicensed"); - /** - * Get the connectivityState property: The connectivity state of the external AAD solution. - * - * @return the connectivityState value. - */ - public AadConnectivityStateValue connectivityState() { - return this.connectivityState; - } + /** Static value Connected for AadConnectivityState. */ + public static final AadConnectivityState CONNECTED = fromString("Connected"); /** - * Set the connectivityState property: The connectivity state of the external AAD solution. + * Creates or finds a AadConnectivityState from its string representation. * - * @param connectivityState the connectivityState value to set. - * @return the AadConnectivityState object itself. + * @param name a name to look for. + * @return the corresponding AadConnectivityState. */ - public AadConnectivityState withConnectivityState(AadConnectivityStateValue connectivityState) { - this.connectivityState = connectivityState; - return this; + @JsonCreator + public static AadConnectivityState fromString(String name) { + return fromString(name, AadConnectivityState.class); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + /** @return known AadConnectivityState values. */ + public static Collection values() { + return values(AadConnectivityState.class); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java new file mode 100644 index 000000000000..646392ea186c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an Azure resource with kind. */ +@Fluent +public class AadConnectivityStateAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadConnectivityStateAutoGenerated.class); + + /* + * The connectivity state of the external AAD solution + */ + @JsonProperty(value = "connectivityState") + private AadConnectivityState connectivityState; + + /** + * Get the connectivityState property: The connectivity state of the external AAD solution. + * + * @return the connectivityState value. + */ + public AadConnectivityState connectivityState() { + return this.connectivityState; + } + + /** + * Set the connectivityState property: The connectivity state of the external AAD solution. + * + * @param connectivityState the connectivityState value to set. + * @return the AadConnectivityStateAutoGenerated object itself. + */ + public AadConnectivityStateAutoGenerated withConnectivityState(AadConnectivityState connectivityState) { + this.connectivityState = connectivityState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateValue.java deleted file mode 100644 index 5f2deb6227ff..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateValue.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AadConnectivityStateValue. */ -public final class AadConnectivityStateValue extends ExpandableStringEnum { - /** Static value Discovered for AadConnectivityStateValue. */ - public static final AadConnectivityStateValue DISCOVERED = fromString("Discovered"); - - /** Static value NotLicensed for AadConnectivityStateValue. */ - public static final AadConnectivityStateValue NOT_LICENSED = fromString("NotLicensed"); - - /** Static value Connected for AadConnectivityStateValue. */ - public static final AadConnectivityStateValue CONNECTED = fromString("Connected"); - - /** - * Creates or finds a AadConnectivityStateValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding AadConnectivityStateValue. - */ - @JsonCreator - public static AadConnectivityStateValue fromString(String name) { - return fromString(name, AadConnectivityStateValue.class); - } - - /** @return known AadConnectivityStateValue values. */ - public static Collection values() { - return values(AadConnectivityStateValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java index e3611d63a3f1..8c4a8171e053 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java @@ -18,14 +18,14 @@ public final class AadSolutionProperties extends ExternalSecuritySolutionPropert * The connectivity state of the external AAD solution */ @JsonProperty(value = "connectivityState") - private AadConnectivityStateValue connectivityState; + private AadConnectivityState connectivityState; /** * Get the connectivityState property: The connectivity state of the external AAD solution. * * @return the connectivityState value. */ - public AadConnectivityStateValue connectivityState() { + public AadConnectivityState connectivityState() { return this.connectivityState; } @@ -35,7 +35,7 @@ public AadConnectivityStateValue connectivityState() { * @param connectivityState the connectivityState value to set. * @return the AadSolutionProperties object itself. */ - public AadSolutionProperties withConnectivityState(AadConnectivityStateValue connectivityState) { + public AadSolutionProperties withConnectivityState(AadConnectivityState connectivityState) { this.connectivityState = connectivityState; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java deleted file mode 100644 index 9e01ef809a19..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AlertIntent. */ -public final class AlertIntent extends ExpandableStringEnum { - /** Static value Unknown for AlertIntent. */ - public static final AlertIntent UNKNOWN = fromString("Unknown"); - - /** Static value PreAttack for AlertIntent. */ - public static final AlertIntent PRE_ATTACK = fromString("PreAttack"); - - /** Static value InitialAccess for AlertIntent. */ - public static final AlertIntent INITIAL_ACCESS = fromString("InitialAccess"); - - /** Static value Persistence for AlertIntent. */ - public static final AlertIntent PERSISTENCE = fromString("Persistence"); - - /** Static value PrivilegeEscalation for AlertIntent. */ - public static final AlertIntent PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); - - /** Static value DefenseEvasion for AlertIntent. */ - public static final AlertIntent DEFENSE_EVASION = fromString("DefenseEvasion"); - - /** Static value CredentialAccess for AlertIntent. */ - public static final AlertIntent CREDENTIAL_ACCESS = fromString("CredentialAccess"); - - /** Static value Discovery for AlertIntent. */ - public static final AlertIntent DISCOVERY = fromString("Discovery"); - - /** Static value LateralMovement for AlertIntent. */ - public static final AlertIntent LATERAL_MOVEMENT = fromString("LateralMovement"); - - /** Static value Execution for AlertIntent. */ - public static final AlertIntent EXECUTION = fromString("Execution"); - - /** Static value Collection for AlertIntent. */ - public static final AlertIntent COLLECTION = fromString("Collection"); - - /** Static value Exfiltration for AlertIntent. */ - public static final AlertIntent EXFILTRATION = fromString("Exfiltration"); - - /** Static value CommandAndControl for AlertIntent. */ - public static final AlertIntent COMMAND_AND_CONTROL = fromString("CommandAndControl"); - - /** Static value Impact for AlertIntent. */ - public static final AlertIntent IMPACT = fromString("Impact"); - - /** Static value Probing for AlertIntent. */ - public static final AlertIntent PROBING = fromString("Probing"); - - /** Static value Exploitation for AlertIntent. */ - public static final AlertIntent EXPLOITATION = fromString("Exploitation"); - - /** - * Creates or finds a AlertIntent from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertIntent. - */ - @JsonCreator - public static AlertIntent fromString(String name) { - return fromString(name, AlertIntent.class); - } - - /** @return known AlertIntent values. */ - public static Collection values() { - return values(AlertIntent.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java index 3c7a749bdce1..e1401f13da18 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java @@ -11,7 +11,7 @@ /** The result of the assessment. */ @Fluent -public final class AssessmentStatus { +public class AssessmentStatus { @JsonIgnore private final ClientLogger logger = new ClientLogger(AssessmentStatus.class); /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java new file mode 100644 index 000000000000..e2630682b53c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The result of the assessment. */ +@Fluent +public final class AssessmentStatusResponse extends AssessmentStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssessmentStatusResponse.class); + + /* + * The time that the assessment was created and first evaluated. Returned + * as UTC time in ISO 8601 format + */ + @JsonProperty(value = "firstEvaluationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstEvaluationDate; + + /* + * The time that the status of the assessment last changed. Returned as UTC + * time in ISO 8601 format + */ + @JsonProperty(value = "statusChangeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime statusChangeDate; + + /** + * Get the firstEvaluationDate property: The time that the assessment was created and first evaluated. Returned as + * UTC time in ISO 8601 format. + * + * @return the firstEvaluationDate value. + */ + public OffsetDateTime firstEvaluationDate() { + return this.firstEvaluationDate; + } + + /** + * Get the statusChangeDate property: The time that the status of the assessment last changed. Returned as UTC time + * in ISO 8601 format. + * + * @return the statusChangeDate value. + */ + public OffsetDateTime statusChangeDate() { + return this.statusChangeDate; + } + + /** {@inheritDoc} */ + @Override + public AssessmentStatusResponse withCode(AssessmentStatusCode code) { + super.withCode(code); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssessmentStatusResponse withCause(String cause) { + super.withCause(cause); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssessmentStatusResponse withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java index db0c6b7e9d66..dc2a3012def5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java @@ -20,7 +20,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return security assessments on all your scanned resources inside a scope. */ - PagedIterable list(String scope); + PagedIterable list(String scope); /** * Get security assessments on all your scanned resources inside a scope. @@ -33,7 +33,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return security assessments on all your scanned resources inside a scope. */ - PagedIterable list(String scope, Context context); + PagedIterable list(String scope, Context context); /** * Get a security assessment on your scanned resource. @@ -45,7 +45,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - SecurityAssessment get(String resourceId, String assessmentName); + SecurityAssessmentResponse get(String resourceId, String assessmentName); /** * Get a security assessment on your scanned resource. @@ -59,7 +59,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - Response getWithResponse( + Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context); /** @@ -97,7 +97,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - SecurityAssessment getById(String id); + SecurityAssessmentResponse getById(String id); /** * Get a security assessment on your scanned resource. @@ -110,7 +110,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - Response getByIdWithResponse(String id, ExpandEnum expand, Context context); + Response getByIdWithResponse(String id, ExpandEnum expand, Context context); /** * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be @@ -137,10 +137,10 @@ Response getWithResponse( Response deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new SecurityAssessment resource. + * Begins definition for a new SecurityAssessmentResponse resource. * * @param name resource name. - * @return the first stage of the new SecurityAssessment definition. + * @return the first stage of the new SecurityAssessmentResponse definition. */ - SecurityAssessment.DefinitionStages.Blank define(String name); + SecurityAssessmentResponse.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java index 2f5081440609..801ee0eba75d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java @@ -17,7 +17,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types. */ - PagedIterable list(); + PagedIterable list(); /** * Get metadata information on all assessment types. @@ -28,7 +28,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types. */ - PagedIterable list(Context context); + PagedIterable list(Context context); /** * Get metadata information on an assessment type. @@ -39,7 +39,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type. */ - SecurityAssessmentMetadata get(String assessmentMetadataName); + SecurityAssessmentMetadataResponse get(String assessmentMetadataName); /** * Get metadata information on an assessment type. @@ -51,7 +51,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type. */ - Response getWithResponse(String assessmentMetadataName, Context context); + Response getWithResponse(String assessmentMetadataName, Context context); /** * Get metadata information on all assessment types in a specific subscription. @@ -60,7 +60,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types in a specific subscription. */ - PagedIterable listBySubscription(); + PagedIterable listBySubscription(); /** * Get metadata information on all assessment types in a specific subscription. @@ -71,7 +71,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types in a specific subscription. */ - PagedIterable listBySubscription(Context context); + PagedIterable listBySubscription(Context context); /** * Get metadata information on an assessment type in a specific subscription. @@ -82,7 +82,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - SecurityAssessmentMetadata getInSubscription(String assessmentMetadataName); + SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName); /** * Get metadata information on an assessment type in a specific subscription. @@ -94,7 +94,8 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - Response getInSubscriptionWithResponse(String assessmentMetadataName, Context context); + Response getInSubscriptionWithResponse( + String assessmentMetadataName, Context context); /** * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the @@ -129,7 +130,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - SecurityAssessmentMetadata getInSubscriptionById(String id); + SecurityAssessmentMetadataResponse getInSubscriptionById(String id); /** * Get metadata information on an assessment type in a specific subscription. @@ -141,7 +142,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - Response getInSubscriptionByIdWithResponse(String id, Context context); + Response getInSubscriptionByIdWithResponse(String id, Context context); /** * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the @@ -168,10 +169,10 @@ public interface AssessmentsMetadatas { Response deleteInSubscriptionByIdWithResponse(String id, Context context); /** - * Begins definition for a new SecurityAssessmentMetadata resource. + * Begins definition for a new SecurityAssessmentMetadataResponse resource. * * @param name resource name. - * @return the first stage of the new SecurityAssessmentMetadata definition. + * @return the first stage of the new SecurityAssessmentMetadataResponse definition. */ - SecurityAssessmentMetadata.DefinitionStages.Blank define(String name); + SecurityAssessmentMetadataResponse.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.java deleted file mode 100644 index 9d668debfd2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AuthorizationState. */ -public final class AuthorizationState extends ExpandableStringEnum { - /** Static value Authorized for AuthorizationState. */ - public static final AuthorizationState AUTHORIZED = fromString("Authorized"); - - /** Static value Unauthorized for AuthorizationState. */ - public static final AuthorizationState UNAUTHORIZED = fromString("Unauthorized"); - - /** - * Creates or finds a AuthorizationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthorizationState. - */ - @JsonCreator - public static AuthorizationState fromString(String name) { - return fromString(name, AuthorizationState.class); - } - - /** @return known AuthorizationState values. */ - public static Collection values() { - return values(AuthorizationState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java deleted file mode 100644 index 6bef396459fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Details of the Azure resource that was assessed. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "source") -@JsonTypeName("Azure") -@Immutable -public final class AzureResourceDetails extends ResourceDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceDetails.class); - - /* - * Azure resource Id of the assessed resource - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Get the id property: Azure resource Id of the assessed resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java index f55e74444075..31c33d484a12 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -32,6 +33,7 @@ public final class ContainerRegistryVulnerabilityProperties extends AdditionalDa * Dictionary from cvss version to cvss details object */ @JsonProperty(value = "cvss", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map cvss; /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java new file mode 100644 index 000000000000..3eb7dde3ce51 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +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 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 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 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.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: GZip encoded KQL query representing the assessment automation + * results required.. + * + * @param compressedQuery GZip 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 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/OnPremiseIotSensors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensors.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java index faa8fa3c2ee1..cf20c98c8708 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensors.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java @@ -4,147 +4,161 @@ package com.azure.resourcemanager.security.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; import com.azure.core.util.Context; -import java.io.InputStream; -/** Resource collection API of OnPremiseIotSensors. */ -public interface OnPremiseIotSensors { +/** Resource collection API of CustomAssessmentAutomations. */ +public interface CustomAssessmentAutomations { /** - * List on-premise IoT sensors. + * 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 list of on-premise IoT sensors. + * @return a single custom assessment automation by name for the provided subscription and resource group. */ - OnPremiseIotSensorsList list(); + CustomAssessmentAutomation getByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); /** - * List on-premise IoT sensors. + * 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 list of on-premise IoT sensors. + * @return a single custom assessment automation by name for the provided subscription and resource group. */ - Response listWithResponse(Context context); + Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context); /** - * Get on-premise IoT sensor. + * Deletes a custom assessment automation by name for a provided subscription. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param 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 on-premise IoT sensor. */ - OnPremiseIotSensor get(String onPremiseIotSensorName); + void deleteByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); /** - * Get on-premise IoT sensor. + * Deletes a custom assessment automation by name for a provided subscription. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param 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 on-premise IoT sensor. + * @return the response. */ - Response getWithResponse(String onPremiseIotSensorName, Context context); + Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, Context context); /** - * Create or update on-premise IoT sensor. + * List custom assessment automations by provided subscription and resource group. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. + * @return a list of Custom Assessment Automations. */ - OnPremiseIotSensor createOrUpdate(String onPremiseIotSensorName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Create or update on-premise IoT sensor. + * List custom assessment automations by provided subscription and resource group. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. + * @return a list of Custom Assessment Automations. */ - Response createOrUpdateWithResponse(String onPremiseIotSensorName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete on-premise IoT sensor. + * List custom assessment automations by provided subscription. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. */ - void delete(String onPremiseIotSensorName); + PagedIterable list(); /** - * Delete on-premise IoT sensor. + * List custom assessment automations by provided subscription. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return a list of Custom Assessment Automations. */ - Response deleteWithResponse(String onPremiseIotSensorName, Context context); + PagedIterable list(Context context); /** - * Download sensor activation file. + * Gets a single custom assessment automation by name for the provided subscription and resource group. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return a single custom assessment automation by name for the provided subscription and resource group. */ - InputStream downloadActivation(String onPremiseIotSensorName); + CustomAssessmentAutomation getById(String id); /** - * Download sensor activation file. + * Gets a single custom assessment automation by name for the provided subscription and resource group. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return a single custom assessment automation by name for the provided subscription and resource group. */ - StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Download file for reset password of the sensor. + * Deletes a custom assessment automation by name for a provided subscription. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body); + void deleteById(String id); /** - * Download file for reset password of the sensor. + * Deletes a custom assessment automation by name for a provided subscription. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context); + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomAssessmentAutomation resource. + * + * @param name resource name. + * @return the first stage of the new CustomAssessmentAutomation definition. + */ + CustomAssessmentAutomation.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java new file mode 100644 index 000000000000..ad8b917ac6e6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Custom Assessment Automations. */ +@Fluent +public final class CustomAssessmentAutomationsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationsListResult.class); + + /* + * Collection of Custom Assessment Automations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Custom Assessment Automations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the CustomAssessmentAutomationsListResult object itself. + */ + public CustomAssessmentAutomationsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Device.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Device.java deleted file mode 100644 index 71d5333cfed3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Device.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Device. */ -public interface Device { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: Device display name given by the collector. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the deviceType property: Device type. - * - * @return the deviceType value. - */ - String deviceType(); - - /** - * Gets the sourceName property: The source that created the device. - * - * @return the sourceName value. - */ - String sourceName(); - - /** - * Gets the networkInterfaces property: List of network interfaces. - * - * @return the networkInterfaces value. - */ - List networkInterfaces(); - - /** - * Gets the vendor property: Device vendor. - * - * @return the vendor value. - */ - String vendor(); - - /** - * Gets the osName property: Device operating system name. - * - * @return the osName value. - */ - String osName(); - - /** - * Gets the protocols property: List of protocols. - * - * @return the protocols value. - */ - List protocols(); - - /** - * Gets the lastActiveTime property: last time the device was active in the network. - * - * @return the lastActiveTime value. - */ - OffsetDateTime lastActiveTime(); - - /** - * Gets the lastUpdateTime property: last time the device was updated. - * - * @return the lastUpdateTime value. - */ - OffsetDateTime lastUpdateTime(); - - /** - * Gets the managementState property: Managed state of the device. - * - * @return the managementState value. - */ - ManagementState managementState(); - - /** - * Gets the authorizationState property: Authorized state of the device. - * - * @return the authorizationState value. - */ - AuthorizationState authorizationState(); - - /** - * Gets the deviceCriticality property: Device criticality. - * - * @return the deviceCriticality value. - */ - DeviceCriticality deviceCriticality(); - - /** - * Gets the purdueLevel property: Purdue level of the device. - * - * @return the purdueLevel value. - */ - PurdueLevel purdueLevel(); - - /** - * Gets the notes property: user notes for the device, up to 300 characters. - * - * @return the notes value. - */ - String notes(); - - /** - * Gets the firmwares property: List of device firmwares. - * - * @return the firmwares value. - */ - List firmwares(); - - /** - * Gets the discoveryTime property: Discovered time of the device. - * - * @return the discoveryTime value. - */ - OffsetDateTime discoveryTime(); - - /** - * Gets the programmingState property: Indicates whether this device is programming. - * - * @return the programmingState value. - */ - ProgrammingState programmingState(); - - /** - * Gets the lastProgrammingTime property: last time the device was programming or programed. - * - * @return the lastProgrammingTime value. - */ - OffsetDateTime lastProgrammingTime(); - - /** - * Gets the scanningFunctionality property: Indicates whether the device is a scanner. - * - * @return the scanningFunctionality value. - */ - ScanningFunctionality scanningFunctionality(); - - /** - * Gets the lastScanTime property: last time the device was scanning. - * - * @return the lastScanTime value. - */ - OffsetDateTime lastScanTime(); - - /** - * Gets the riskScore property: risk score of the device. - * - * @return the riskScore value. - */ - Integer riskScore(); - - /** - * Gets the sensors property: List of sensors that scanned this device. - * - * @return the sensors value. - */ - List sensors(); - - /** - * Gets the site property: Site data. - * - * @return the site value. - */ - Site site(); - - /** - * Gets the deviceStatus property: Device status. - * - * @return the deviceStatus value. - */ - DeviceStatus deviceStatus(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DeviceInner object. - * - * @return the inner object. - */ - DeviceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.java deleted file mode 100644 index 0ad8a0d59c09..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DeviceCriticality. */ -public final class DeviceCriticality extends ExpandableStringEnum { - /** Static value Important for DeviceCriticality. */ - public static final DeviceCriticality IMPORTANT = fromString("Important"); - - /** Static value Standard for DeviceCriticality. */ - public static final DeviceCriticality STANDARD = fromString("Standard"); - - /** - * Creates or finds a DeviceCriticality from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceCriticality. - */ - @JsonCreator - public static DeviceCriticality fromString(String name) { - return fromString(name, DeviceCriticality.class); - } - - /** @return known DeviceCriticality values. */ - public static Collection values() { - return values(DeviceCriticality.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceList.java deleted file mode 100644 index 24fd4db7ce11..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Devices. */ -@Fluent -public final class DeviceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceList.class); - - /* - * List of devices - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * When there are too many devices for one page, use this URI to fetch the - * next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of devices. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of devices. - * - * @param value the value value to set. - * @return the DeviceList object itself. - */ - public DeviceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: When there are too many devices for one page, use this URI to fetch the next page. - * - * @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 - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DeviceList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.java deleted file mode 100644 index e45e5661f745..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DeviceStatus. */ -public final class DeviceStatus extends ExpandableStringEnum { - /** Static value Active for DeviceStatus. */ - public static final DeviceStatus ACTIVE = fromString("Active"); - - /** Static value Removed for DeviceStatus. */ - public static final DeviceStatus REMOVED = fromString("Removed"); - - /** - * Creates or finds a DeviceStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceStatus. - */ - @JsonCreator - public static DeviceStatus fromString(String name) { - return fromString(name, DeviceStatus.class); - } - - /** @return known DeviceStatus values. */ - public static Collection values() { - return values(DeviceStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.java deleted file mode 100644 index 202f64be237e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Devices. */ -public interface Devices { - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - Device get(String resourceId, String deviceId); - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - Response getWithResponse(String resourceId, String deviceId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.java deleted file mode 100644 index f2da70879d18..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of DevicesForHubs. */ -public interface DevicesForHubs { - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - PagedIterable list(String resourceId); - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.java deleted file mode 100644 index b53f278dc088..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of DevicesForSubscriptions. */ -public interface DevicesForSubscriptions { - /** - * Get list of the devices by their subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - PagedIterable list(); - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices by their subscription. - */ - PagedIterable list(Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java new file mode 100644 index 000000000000..7d480b549207 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExternalSecuritySolutionKind. */ +public final class ExternalSecuritySolutionKind extends ExpandableStringEnum { + /** Static value CEF for ExternalSecuritySolutionKind. */ + public static final ExternalSecuritySolutionKind CEF = fromString("CEF"); + + /** Static value ATA for ExternalSecuritySolutionKind. */ + public static final ExternalSecuritySolutionKind ATA = fromString("ATA"); + + /** Static value AAD for ExternalSecuritySolutionKind. */ + public static final ExternalSecuritySolutionKind AAD = fromString("AAD"); + + /** + * Creates or finds a ExternalSecuritySolutionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExternalSecuritySolutionKind. + */ + @JsonCreator + public static ExternalSecuritySolutionKind fromString(String name) { + return fromString(name, ExternalSecuritySolutionKind.class); + } + + /** @return known ExternalSecuritySolutionKind values. */ + public static Collection values() { + return values(ExternalSecuritySolutionKind.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.java deleted file mode 100644 index d77e2eea62ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExternalSecuritySolutionKindValue. */ -public final class ExternalSecuritySolutionKindValue extends ExpandableStringEnum { - /** Static value CEF for ExternalSecuritySolutionKindValue. */ - public static final ExternalSecuritySolutionKindValue CEF = fromString("CEF"); - - /** Static value ATA for ExternalSecuritySolutionKindValue. */ - public static final ExternalSecuritySolutionKindValue ATA = fromString("ATA"); - - /** Static value AAD for ExternalSecuritySolutionKindValue. */ - public static final ExternalSecuritySolutionKindValue AAD = fromString("AAD"); - - /** - * Creates or finds a ExternalSecuritySolutionKindValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExternalSecuritySolutionKindValue. - */ - @JsonCreator - public static ExternalSecuritySolutionKindValue fromString(String name) { - return fromString(name, ExternalSecuritySolutionKindValue.class); - } - - /** @return known ExternalSecuritySolutionKindValue values. */ - public static Collection values() { - return values(ExternalSecuritySolutionKindValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java deleted file mode 100644 index d1fa6bff3264..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Firmware information. */ -@Immutable -public final class Firmware { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Firmware.class); - - /* - * Address of the specific module a firmware is related to - */ - @JsonProperty(value = "moduleAddress", access = JsonProperty.Access.WRITE_ONLY) - private String moduleAddress; - - /* - * Rack number of the module a firmware is related to. - */ - @JsonProperty(value = "rack", access = JsonProperty.Access.WRITE_ONLY) - private String rack; - - /* - * Slot number in the rack of the module a firmware is related to - */ - @JsonProperty(value = "slot", access = JsonProperty.Access.WRITE_ONLY) - private String slot; - - /* - * Serial of the firmware - */ - @JsonProperty(value = "serial", access = JsonProperty.Access.WRITE_ONLY) - private String serial; - - /* - * Firmware model - */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) - private String model; - - /* - * Firmware version - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * A bag of fields which extends the firmware information. - */ - @JsonProperty(value = "additionalData", access = JsonProperty.Access.WRITE_ONLY) - private Object additionalData; - - /** - * Get the moduleAddress property: Address of the specific module a firmware is related to. - * - * @return the moduleAddress value. - */ - public String moduleAddress() { - return this.moduleAddress; - } - - /** - * Get the rack property: Rack number of the module a firmware is related to. - * - * @return the rack value. - */ - public String rack() { - return this.rack; - } - - /** - * Get the slot property: Slot number in the rack of the module a firmware is related to. - * - * @return the slot value. - */ - public String slot() { - return this.slot; - } - - /** - * Get the serial property: Serial of the firmware. - * - * @return the serial value. - */ - public String serial() { - return this.serial; - } - - /** - * Get the model property: Firmware model. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Get the version property: Firmware version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the additionalData property: A bag of fields which extends the firmware information. - * - * @return the additionalData value. - */ - public Object additionalData() { - return this.additionalData; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.java deleted file mode 100644 index b28c3830e14f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT alerts. */ -@Immutable -public final class IotAlertListModel { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertListModel.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * When available, follow the URI to get the next page of data - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: When available, follow the URI to get the next page of data. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java deleted file mode 100644 index fec18e0dabcc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import java.util.List; - -/** An immutable client-side representation of IotAlertModel. */ -public interface IotAlertModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemAlertId property: Holds the product canonical identifier of the alert within the scope of a - * product. - * - * @return the systemAlertId value. - */ - String systemAlertId(); - - /** - * Gets the compromisedEntity property: Display name of the main entity being reported on. - * - * @return the compromisedEntity value. - */ - String compromisedEntity(); - - /** - * Gets the alertType property: The type name of the alert. - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the startTimeUtc property: The impact start time of the alert (the time of the first event or activity - * included in the alert). - * - * @return the startTimeUtc value. - */ - String startTimeUtc(); - - /** - * Gets the endTimeUtc property: The impact end time of the alert (the time of the last event or activity included - * in the alert). - * - * @return the endTimeUtc value. - */ - String endTimeUtc(); - - /** - * Gets the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - List entities(); - - /** - * Gets the extendedProperties property: A bag of fields which extends the alert information. - * - * @return the extendedProperties value. - */ - Object extendedProperties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotAlertModelInner object. - * - * @return the inner object. - */ - IotAlertModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java deleted file mode 100644 index 8a685cd60ccf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import java.util.List; - -/** An immutable client-side representation of IotAlertType. */ -public interface IotAlertType { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - String alertDisplayName(); - - /** - * Gets the severity property: The severity of the alert. - * - * @return the severity value. - */ - AlertSeverity severity(); - - /** - * Gets the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - String description(); - - /** - * Gets the providerName property: The name of the alert provider or internal partner. - * - * @return the providerName value. - */ - String providerName(); - - /** - * Gets the productName property: The name of the product which published this alert. - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the productComponentName property: The name of a component inside the product which generated the alert. - * - * @return the productComponentName value. - */ - String productComponentName(); - - /** - * Gets the vendorName property: The name of the vendor that raise the alert. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the intent property: Kill chain related intent behind the alert. Could contain multiple enum values - * (separated by commas). - * - * @return the intent value. - */ - AlertIntent intent(); - - /** - * Gets the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - List remediationSteps(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner object. - * - * @return the inner object. - */ - IotAlertTypeInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.java deleted file mode 100644 index da62daaa422c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; -import java.util.List; - -/** An immutable client-side representation of IotAlertTypeList. */ -public interface IotAlertTypeList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner object. - * - * @return the inner object. - */ - IotAlertTypeListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypes.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypes.java deleted file mode 100644 index a7a8ee28a7d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypes.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotAlertTypes. */ -public interface IotAlertTypes { - /** - * List IoT alert types. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - IotAlertTypeList list(); - - /** - * List IoT alert types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of alert types. - */ - Response listWithResponse(Context context); - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - IotAlertType get(String iotAlertTypeName); - - /** - * Get IoT alert type. - * - * @param iotAlertTypeName Name of the alert type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert type. - */ - Response getWithResponse(String iotAlertTypeName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.java deleted file mode 100644 index 66911a0a93f8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotAlerts. */ -public interface IotAlerts { - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - PagedIterable list(String scope); - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT alerts. - */ - PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - IotAlertModel get(String scope, String iotAlertId); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - Response getWithResponse(String scope, String iotAlertId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java deleted file mode 100644 index 3d65b1674e48..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import java.io.InputStream; - -/** Resource collection API of IotDefenderSettings. */ -public interface IotDefenderSettings { - /** - * List IoT Defender Settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - IotDefenderSettingsList list(); - - /** - * List IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Defender settings. - */ - Response listWithResponse(Context context); - - /** - * Get IoT Defender Settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - IotDefenderSettingsModel get(); - - /** - * Get IoT Defender Settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - Response getWithResponse(Context context); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - IotDefenderSettingsModel createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context); - - /** - * Delete IoT Defender settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(); - - /** - * Delete IoT Defender settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse(Context context); - - /** - * Information about downloadable packages. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - PackageDownloads packageDownloads(); - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - Response packageDownloadsWithResponse(Context context); - - /** - * Download manager activation data defined for this subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadManagerActivation(); - - /** - * Download manager activation data defined for this subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadManagerActivationWithResponse(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.java deleted file mode 100644 index 5c6269219dfb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import java.util.List; - -/** An immutable client-side representation of IotDefenderSettingsList. */ -public interface IotDefenderSettingsList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner object. - * - * @return the inner object. - */ - IotDefenderSettingsListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.java deleted file mode 100644 index 0ea1211c2022..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of IotDefenderSettingsModel. */ -public interface IotDefenderSettingsModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the deviceQuota property: Size of the device quota (as a opposed to a Pay as You Go billing model). Value is - * required to be in multiples of 1000. - * - * @return the deviceQuota value. - */ - Integer deviceQuota(); - - /** - * Gets the sentinelWorkspaceResourceIds property: Sentinel Workspace Resource Ids. - * - * @return the sentinelWorkspaceResourceIds value. - */ - List sentinelWorkspaceResourceIds(); - - /** - * Gets the onboardingKind property: The kind of onboarding for the subscription. - * - * @return the onboardingKind value. - */ - OnboardingKind onboardingKind(); - - /** - * Gets the evaluationEndTime property: End time of the evaluation period, if such exist. - * - * @return the evaluationEndTime value. - */ - OffsetDateTime evaluationEndTime(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner object. - * - * @return the inner object. - */ - IotDefenderSettingsModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.java deleted file mode 100644 index d4120658d875..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT recommendations. */ -@Immutable -public final class IotRecommendationListModel { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationListModel.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * When available, follow the URI to get the next page of data - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: When available, follow the URI to get the next page of data. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.java deleted file mode 100644 index b9d958d5f5b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; - -/** An immutable client-side representation of IotRecommendationModel. */ -public interface IotRecommendationModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the deviceId property: Identifier of the device being reported on. - * - * @return the deviceId value. - */ - String deviceId(); - - /** - * Gets the recommendationType property: The type name of the recommendation. - * - * @return the recommendationType value. - */ - String recommendationType(); - - /** - * Gets the discoveredTimeUtc property: The discovery time of the recommendation. - * - * @return the discoveredTimeUtc value. - */ - String discoveredTimeUtc(); - - /** - * Gets the recommendationAdditionalData property: A bag of fields which extends the recommendation information. - * - * @return the recommendationAdditionalData value. - */ - Object recommendationAdditionalData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner object. - * - * @return the inner object. - */ - IotRecommendationModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java deleted file mode 100644 index 62d8be131c2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import java.util.List; - -/** An immutable client-side representation of IotRecommendationType. */ -public interface IotRecommendationType { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the recommendationDisplayName property: The display name of the recommendation. - * - * @return the recommendationDisplayName value. - */ - String recommendationDisplayName(); - - /** - * Gets the severity property: The severity of the recommendation. - * - * @return the severity value. - */ - RecommendationSeverity severity(); - - /** - * Gets the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - String description(); - - /** - * Gets the productName property: The name of the product which published this recommendation. - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the productComponentName property: The name of a component inside the product which generated the - * recommendation. - * - * @return the productComponentName value. - */ - String productComponentName(); - - /** - * Gets the vendorName property: The name of the vendor that raised the recommendation. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the control property: The name of the recommendation's control category. - * - * @return the control value. - */ - String control(); - - /** - * Gets the remediationSteps property: Manual action items to take to resolve the recommendation. - * - * @return the remediationSteps value. - */ - List remediationSteps(); - - /** - * Gets the dataSource property: The alert's data source. - * - * @return the dataSource value. - */ - String dataSource(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner object. - * - * @return the inner object. - */ - IotRecommendationTypeInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.java deleted file mode 100644 index 40e74c69e017..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import java.util.List; - -/** An immutable client-side representation of IotRecommendationTypeList. */ -public interface IotRecommendationTypeList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner object. - * - * @return the inner object. - */ - IotRecommendationTypeListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.java deleted file mode 100644 index e0fb570ca48c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotRecommendationTypes. */ -public interface IotRecommendationTypes { - /** - * List IoT recommendation types. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - IotRecommendationTypeList list(); - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of recommendation types. - */ - Response listWithResponse(Context context); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - IotRecommendationType get(String iotRecommendationTypeName); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation type. - */ - Response getWithResponse(String iotRecommendationTypeName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.java deleted file mode 100644 index f0769d010d28..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotRecommendations. */ -public interface IotRecommendations { - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - PagedIterable list(String scope); - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT recommendations. - */ - PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - IotRecommendationModel get(String scope, String iotRecommendationId); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - Response getWithResponse(String scope, String iotRecommendationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java deleted file mode 100644 index 917b57deb6b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import java.io.InputStream; - -/** Resource collection API of IotSensors. */ -public interface IotSensors { - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - IotSensorsList list(String scope); - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sensors. - */ - Response listWithResponse(String scope, Context context); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - IotSensorsModel get(String scope, String iotSensorName); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - Response getWithResponse(String scope, String iotSensorName, Context context); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String scope, String iotSensorName); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadActivation(String scope, String iotSensorName); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void triggerTiPackageUpdate(String scope, String iotSensorName); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context); - - /** - * Get IoT sensor. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - IotSensorsModel getById(String id); - - /** - * Get IoT sensor. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete IoT sensor. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete IoT sensor. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new IotSensorsModel resource. - * - * @param name resource name. - * @return the first stage of the new IotSensorsModel definition. - */ - IotSensorsModel.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.java deleted file mode 100644 index 90434ffaf7d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import java.util.List; - -/** An immutable client-side representation of IotSensorsList. */ -public interface IotSensorsList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSensorsListInner object. - * - * @return the inner object. - */ - IotSensorsListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java deleted file mode 100644 index 866e912fe7f1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import java.io.InputStream; - -/** An immutable client-side representation of IotSensorsModel. */ -public interface IotSensorsModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the connectivityTime property: Last connectivity time of the IoT sensor. - * - * @return the connectivityTime value. - */ - String connectivityTime(); - - /** - * Gets the creationTime property: Creation time of the IoT sensor. - * - * @return the creationTime value. - */ - String creationTime(); - - /** - * Gets the dynamicLearning property: Dynamic mode status of the IoT sensor. - * - * @return the dynamicLearning value. - */ - Boolean dynamicLearning(); - - /** - * Gets the learningMode property: Learning mode status of the IoT sensor. - * - * @return the learningMode value. - */ - Boolean learningMode(); - - /** - * Gets the sensorStatus property: Status of the IoT sensor. - * - * @return the sensorStatus value. - */ - SensorStatus sensorStatus(); - - /** - * Gets the sensorVersion property: Version of the IoT sensor. - * - * @return the sensorVersion value. - */ - String sensorVersion(); - - /** - * Gets the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @return the tiAutomaticUpdates value. - */ - Boolean tiAutomaticUpdates(); - - /** - * Gets the tiStatus property: TI Status of the IoT sensor. - * - * @return the tiStatus value. - */ - TiStatus tiStatus(); - - /** - * Gets the tiVersion property: TI Version of the IoT sensor. - * - * @return the tiVersion value. - */ - String tiVersion(); - - /** - * Gets the zone property: Zone of the IoT sensor. - * - * @return the zone value. - */ - String zone(); - - /** - * Gets the sensorType property: Type of sensor. - * - * @return the sensorType value. - */ - SensorType sensorType(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner object. - * - * @return the inner object. - */ - IotSensorsModelInner innerModel(); - - /** The entirety of the IotSensorsModel definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The IotSensorsModel definition stages. */ - interface DefinitionStages { - /** The first stage of the IotSensorsModel definition. */ - interface Blank extends WithScope { - } - /** The stage of the IotSensorsModel definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies scope. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @return the next definition stage. - */ - WithCreate withExistingScope(String scope); - } - /** - * The stage of the IotSensorsModel definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTiAutomaticUpdates, - DefinitionStages.WithZone, - DefinitionStages.WithSensorType { - /** - * Executes the create request. - * - * @return the created resource. - */ - IotSensorsModel create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - IotSensorsModel create(Context context); - } - /** The stage of the IotSensorsModel definition allowing to specify tiAutomaticUpdates. */ - interface WithTiAutomaticUpdates { - /** - * Specifies the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @param tiAutomaticUpdates TI Automatic mode status of the IoT sensor. - * @return the next definition stage. - */ - WithCreate withTiAutomaticUpdates(Boolean tiAutomaticUpdates); - } - /** The stage of the IotSensorsModel definition allowing to specify zone. */ - interface WithZone { - /** - * Specifies the zone property: Zone of the IoT sensor. - * - * @param zone Zone of the IoT sensor. - * @return the next definition stage. - */ - WithCreate withZone(String zone); - } - /** The stage of the IotSensorsModel definition allowing to specify sensorType. */ - interface WithSensorType { - /** - * Specifies the sensorType property: Type of sensor. - * - * @param sensorType Type of sensor. - * @return the next definition stage. - */ - WithCreate withSensorType(SensorType sensorType); - } - } - /** - * Begins update for the IotSensorsModel resource. - * - * @return the stage of resource update. - */ - IotSensorsModel.Update update(); - - /** The template for IotSensorsModel update. */ - interface Update extends UpdateStages.WithTiAutomaticUpdates, UpdateStages.WithZone, UpdateStages.WithSensorType { - /** - * Executes the update request. - * - * @return the updated resource. - */ - IotSensorsModel apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - IotSensorsModel apply(Context context); - } - /** The IotSensorsModel update stages. */ - interface UpdateStages { - /** The stage of the IotSensorsModel update allowing to specify tiAutomaticUpdates. */ - interface WithTiAutomaticUpdates { - /** - * Specifies the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @param tiAutomaticUpdates TI Automatic mode status of the IoT sensor. - * @return the next definition stage. - */ - Update withTiAutomaticUpdates(Boolean tiAutomaticUpdates); - } - /** The stage of the IotSensorsModel update allowing to specify zone. */ - interface WithZone { - /** - * Specifies the zone property: Zone of the IoT sensor. - * - * @param zone Zone of the IoT sensor. - * @return the next definition stage. - */ - Update withZone(String zone); - } - /** The stage of the IotSensorsModel update allowing to specify sensorType. */ - interface WithSensorType { - /** - * Specifies the sensorType property: Type of sensor. - * - * @param sensorType Type of sensor. - * @return the next definition stage. - */ - Update withSensorType(SensorType sensorType); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - IotSensorsModel refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - IotSensorsModel refresh(Context context); - - /** - * Download sensor activation file. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadActivation(); - - /** - * Download sensor activation file. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadActivationWithResponse(Context context); - - /** - * Download file for reset password of the sensor. - * - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadResetPassword(ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadResetPasswordWithResponse(ResetPasswordInput body, Context context); - - /** - * Trigger threat intelligence package update. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void triggerTiPackageUpdate(); - - /** - * Trigger threat intelligence package update. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response triggerTiPackageUpdateWithResponse(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java deleted file mode 100644 index e2328a0f13a4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; - -/** Resource collection API of IotSites. */ -public interface IotSites { - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - IotSitesList list(String scope); - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT sites. - */ - Response listWithResponse(String scope, Context context); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - IotSitesModel get(String scope); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - Response getWithResponse(String scope, Context context); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - IotSitesModel createOrUpdate(String scope, IotSitesModelInner iotSitesModel); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - Response createOrUpdateWithResponse(String scope, IotSitesModelInner iotSitesModel, Context context); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String scope); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.java deleted file mode 100644 index f21b8fa26903..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import java.util.List; - -/** An immutable client-side representation of IotSitesList. */ -public interface IotSitesList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSitesListInner object. - * - * @return the inner object. - */ - IotSitesListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.java deleted file mode 100644 index 395e7a66b747..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import java.util.Map; - -/** An immutable client-side representation of IotSitesModel. */ -public interface IotSitesModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: Display name of the IoT site. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the tags property: Tags of the IoT site. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSitesModelInner object. - * - * @return the inner object. - */ - IotSitesModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.java deleted file mode 100644 index c784e2216018..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** IP Address information. */ -@Immutable -public final class IpAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddress.class); - - /* - * IPV4 address - */ - @JsonProperty(value = "v4Address", access = JsonProperty.Access.WRITE_ONLY) - private String v4Address; - - /* - * Detection time of the ip address. - */ - @JsonProperty(value = "detectionTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime detectionTime; - - /* - * Subnet Classless Inter-Domain Routing - */ - @JsonProperty(value = "subnetCidr", access = JsonProperty.Access.WRITE_ONLY) - private String subnetCidr; - - /* - * Fully qualified domain name - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * FQDN last lookup time. - */ - @JsonProperty(value = "fqdnLastLookupTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime fqdnLastLookupTime; - - /** - * Get the v4Address property: IPV4 address. - * - * @return the v4Address value. - */ - public String v4Address() { - return this.v4Address; - } - - /** - * Get the detectionTime property: Detection time of the ip address. - * - * @return the detectionTime value. - */ - public OffsetDateTime detectionTime() { - return this.detectionTime; - } - - /** - * Get the subnetCidr property: Subnet Classless Inter-Domain Routing. - * - * @return the subnetCidr value. - */ - public String subnetCidr() { - return this.subnetCidr; - } - - /** - * Get the fqdn property: Fully qualified domain name. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the fqdnLastLookupTime property: FQDN last lookup time. - * - * @return the fqdnLastLookupTime value. - */ - public OffsetDateTime fqdnLastLookupTime() { - return this.fqdnLastLookupTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java index 37ef46d6e1e9..9b43e6ac7a28 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java @@ -25,7 +25,7 @@ public final class JitNetworkAccessPortRule { * The protocol property. */ @JsonProperty(value = "protocol", required = true) - private ProtocolValue protocol; + private Protocol protocol; /* * Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. @@ -73,7 +73,7 @@ public JitNetworkAccessPortRule withNumber(int number) { * * @return the protocol value. */ - public ProtocolValue protocol() { + public Protocol protocol() { return this.protocol; } @@ -83,7 +83,7 @@ public ProtocolValue protocol() { * @param protocol the protocol value to set. * @return the JitNetworkAccessPortRule object itself. */ - public JitNetworkAccessPortRule withProtocol(ProtocolValue protocol) { + public JitNetworkAccessPortRule withProtocol(Protocol protocol) { this.protocol = protocol; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java index 6ffd19d58f03..4feac3222986 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java @@ -4,47 +4,28 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; -/** Describes an Azure resource with kind. */ -@Fluent -public class Kind { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Kind.class); - - /* - * Kind of the resource - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } +/** Defines values for Kind. */ +public final class Kind extends ExpandableStringEnum { + /** Static value Bundles for Kind. */ + public static final Kind BUNDLES = fromString("Bundles"); /** - * Set the kind property: Kind of the resource. + * Creates or finds a Kind from its string representation. * - * @param kind the kind value to set. - * @return the Kind object itself. + * @param name a name to look for. + * @return the corresponding Kind. */ - public Kind withKind(String kind) { - this.kind = kind; - return this; + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + /** @return known Kind values. */ + public static Collection values() { + return values(Kind.class); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResetPasswordInput.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResetPasswordInput.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java index f2cab92fffb6..9b35831558a8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResetPasswordInput.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java @@ -9,34 +9,34 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Reset password input. */ +/** Describes an Azure resource with kind. */ @Fluent -public final class ResetPasswordInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResetPasswordInput.class); +public class KindAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KindAutoGenerated.class); /* - * The appliance id of the sensor. + * Kind of the resource */ - @JsonProperty(value = "applianceId") - private String applianceId; + @JsonProperty(value = "kind") + private String kind; /** - * Get the applianceId property: The appliance id of the sensor. + * Get the kind property: Kind of the resource. * - * @return the applianceId value. + * @return the kind value. */ - public String applianceId() { - return this.applianceId; + public String kind() { + return this.kind; } /** - * Set the applianceId property: The appliance id of the sensor. + * Set the kind property: Kind of the resource. * - * @param applianceId the applianceId value to set. - * @return the ResetPasswordInput object itself. + * @param kind the kind value to set. + * @return the KindAutoGenerated object itself. */ - public ResetPasswordInput withApplianceId(String applianceId) { - this.applianceId = applianceId; + public KindAutoGenerated withKind(String kind) { + this.kind = kind; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.java deleted file mode 100644 index e8b8cda66147..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KindValue. */ -public final class KindValue extends ExpandableStringEnum { - /** Static value Bundles for KindValue. */ - public static final KindValue BUNDLES = fromString("Bundles"); - - /** - * Creates or finds a KindValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding KindValue. - */ - @JsonCreator - public static KindValue fromString(String name) { - return fromString(name, KindValue.class); - } - - /** @return known KindValue values. */ - public static Collection values() { - return values(KindValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.java deleted file mode 100644 index 037adcaea602..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** MAC Address information. */ -@Immutable -public final class MacAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MacAddress.class); - - /* - * MAC address - */ - @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) - private String address; - - /* - * Detection time of the mac address. - */ - @JsonProperty(value = "detectionTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime detectionTime; - - /* - * Indicates whether this is the primary secondary MAC address of the - * device - */ - @JsonProperty(value = "significance", access = JsonProperty.Access.WRITE_ONLY) - private MacSignificance significance; - - /* - * Indicates whether the relation of the mac to the ip address is certain - * or a guess - */ - @JsonProperty(value = "relationToIpStatus", access = JsonProperty.Access.WRITE_ONLY) - private RelationToIpStatus relationToIpStatus; - - /** - * Get the address property: MAC address. - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Get the detectionTime property: Detection time of the mac address. - * - * @return the detectionTime value. - */ - public OffsetDateTime detectionTime() { - return this.detectionTime; - } - - /** - * Get the significance property: Indicates whether this is the primary secondary MAC address of the device. - * - * @return the significance value. - */ - public MacSignificance significance() { - return this.significance; - } - - /** - * Get the relationToIpStatus property: Indicates whether the relation of the mac to the ip address is certain or a - * guess. - * - * @return the relationToIpStatus value. - */ - public RelationToIpStatus relationToIpStatus() { - return this.relationToIpStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacSignificance.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacSignificance.java deleted file mode 100644 index 9c3aebd6eb0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacSignificance.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MacSignificance. */ -public final class MacSignificance extends ExpandableStringEnum { - /** Static value Primary for MacSignificance. */ - public static final MacSignificance PRIMARY = fromString("Primary"); - - /** Static value Secondary for MacSignificance. */ - public static final MacSignificance SECONDARY = fromString("Secondary"); - - /** - * Creates or finds a MacSignificance from its string representation. - * - * @param name a name to look for. - * @return the corresponding MacSignificance. - */ - @JsonCreator - public static MacSignificance fromString(String name) { - return fromString(name, MacSignificance.class); - } - - /** @return known MacSignificance values. */ - public static Collection values() { - return values(MacSignificance.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.java deleted file mode 100644 index eb5b3508b35e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagementState. */ -public final class ManagementState extends ExpandableStringEnum { - /** Static value Managed for ManagementState. */ - public static final ManagementState MANAGED = fromString("Managed"); - - /** Static value Unmanaged for ManagementState. */ - public static final ManagementState UNMANAGED = fromString("Unmanaged"); - - /** - * Creates or finds a ManagementState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagementState. - */ - @JsonCreator - public static ManagementState fromString(String name) { - return fromString(name, ManagementState.class); - } - - /** @return known ManagementState values. */ - public static Collection values() { - return values(ManagementState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java deleted file mode 100644 index 6670a53f57fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network interface. */ -@Fluent -public final class NetworkInterface { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterface.class); - - /* - * IP Address information - */ - @JsonProperty(value = "ipAddress") - private IpAddress ipAddress; - - /* - * MAC Address information - */ - @JsonProperty(value = "macAddress") - private MacAddress macAddress; - - /* - * List of device vlans. - */ - @JsonProperty(value = "vlans", access = JsonProperty.Access.WRITE_ONLY) - private List vlans; - - /** - * Get the ipAddress property: IP Address information. - * - * @return the ipAddress value. - */ - public IpAddress ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: IP Address information. - * - * @param ipAddress the ipAddress value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withIpAddress(IpAddress ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the macAddress property: MAC Address information. - * - * @return the macAddress value. - */ - public MacAddress macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: MAC Address information. - * - * @param macAddress the macAddress value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withMacAddress(MacAddress macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the vlans property: List of device vlans. - * - * @return the vlans value. - */ - public List vlans() { - return this.vlans; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipAddress() != null) { - ipAddress().validate(); - } - if (macAddress() != null) { - macAddress().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.java deleted file mode 100644 index 235c298fe0ee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; - -/** An immutable client-side representation of OnPremiseIotSensor. */ -public interface OnPremiseIotSensor { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: On-premise IoT sensor properties. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner object. - * - * @return the inner object. - */ - OnPremiseIotSensorInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.java deleted file mode 100644 index 4df50b2a0521..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import java.util.List; - -/** An immutable client-side representation of OnPremiseIotSensorsList. */ -public interface OnPremiseIotSensorsList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner object. - * - * @return the inner object. - */ - OnPremiseIotSensorsListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.java deleted file mode 100644 index 9ac762fa5a14..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Details of the On Premise resource that was assessed. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "source", - defaultImpl = OnPremiseResourceDetails.class) -@JsonTypeName("OnPremise") -@JsonSubTypes({@JsonSubTypes.Type(name = "OnPremiseSql", value = OnPremiseSqlResourceDetails.class)}) -@Fluent -public class OnPremiseResourceDetails extends ResourceDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseResourceDetails.class); - - /* - * Azure resource Id of the workspace the machine is attached to - */ - @JsonProperty(value = "workspaceId", required = true) - private String workspaceId; - - /* - * The unique Id of the machine - */ - @JsonProperty(value = "vmuuid", required = true) - private String vmuuid; - - /* - * The oms agent Id installed on the machine - */ - @JsonProperty(value = "sourceComputerId", required = true) - private String sourceComputerId; - - /* - * The name of the machine - */ - @JsonProperty(value = "machineName", required = true) - private String machineName; - - /** - * Get the workspaceId property: Azure resource Id of the workspace the machine is attached to. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Set the workspaceId property: Azure resource Id of the workspace the machine is attached to. - * - * @param workspaceId the workspaceId value to set. - * @return the OnPremiseResourceDetails object itself. - */ - public OnPremiseResourceDetails withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - return this; - } - - /** - * Get the vmuuid property: The unique Id of the machine. - * - * @return the vmuuid value. - */ - public String vmuuid() { - return this.vmuuid; - } - - /** - * Set the vmuuid property: The unique Id of the machine. - * - * @param vmuuid the vmuuid value to set. - * @return the OnPremiseResourceDetails object itself. - */ - public OnPremiseResourceDetails withVmuuid(String vmuuid) { - this.vmuuid = vmuuid; - return this; - } - - /** - * Get the sourceComputerId property: The oms agent Id installed on the machine. - * - * @return the sourceComputerId value. - */ - public String sourceComputerId() { - return this.sourceComputerId; - } - - /** - * Set the sourceComputerId property: The oms agent Id installed on the machine. - * - * @param sourceComputerId the sourceComputerId value to set. - * @return the OnPremiseResourceDetails object itself. - */ - public OnPremiseResourceDetails withSourceComputerId(String sourceComputerId) { - this.sourceComputerId = sourceComputerId; - return this; - } - - /** - * Get the machineName property: The name of the machine. - * - * @return the machineName value. - */ - public String machineName() { - return this.machineName; - } - - /** - * Set the machineName property: The name of the machine. - * - * @param machineName the machineName value to set. - * @return the OnPremiseResourceDetails object itself. - */ - public OnPremiseResourceDetails withMachineName(String machineName) { - this.machineName = machineName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (workspaceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workspaceId in model OnPremiseResourceDetails")); - } - if (vmuuid() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property vmuuid in model OnPremiseResourceDetails")); - } - if (sourceComputerId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceComputerId in model OnPremiseResourceDetails")); - } - if (machineName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property machineName in model OnPremiseResourceDetails")); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseSqlResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseSqlResourceDetails.java deleted file mode 100644 index b12d82dd4839..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseSqlResourceDetails.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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Details of the On Premise Sql resource that was assessed. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "source") -@JsonTypeName("OnPremiseSql") -@Fluent -public final class OnPremiseSqlResourceDetails extends OnPremiseResourceDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseSqlResourceDetails.class); - - /* - * The Sql server name installed on the machine - */ - @JsonProperty(value = "serverName", required = true) - private String serverName; - - /* - * The Sql database name installed on the machine - */ - @JsonProperty(value = "databaseName", required = true) - private String databaseName; - - /** - * Get the serverName property: The Sql server name installed on the machine. - * - * @return the serverName value. - */ - public String serverName() { - return this.serverName; - } - - /** - * Set the serverName property: The Sql server name installed on the machine. - * - * @param serverName the serverName value to set. - * @return the OnPremiseSqlResourceDetails object itself. - */ - public OnPremiseSqlResourceDetails withServerName(String serverName) { - this.serverName = serverName; - return this; - } - - /** - * Get the databaseName property: The Sql database name installed on the machine. - * - * @return the databaseName value. - */ - public String databaseName() { - return this.databaseName; - } - - /** - * Set the databaseName property: The Sql database name installed on the machine. - * - * @param databaseName the databaseName value to set. - * @return the OnPremiseSqlResourceDetails object itself. - */ - public OnPremiseSqlResourceDetails withDatabaseName(String databaseName) { - this.databaseName = databaseName; - return this; - } - - /** {@inheritDoc} */ - @Override - public OnPremiseSqlResourceDetails withWorkspaceId(String workspaceId) { - super.withWorkspaceId(workspaceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public OnPremiseSqlResourceDetails withVmuuid(String vmuuid) { - super.withVmuuid(vmuuid); - return this; - } - - /** {@inheritDoc} */ - @Override - public OnPremiseSqlResourceDetails withSourceComputerId(String sourceComputerId) { - super.withSourceComputerId(sourceComputerId); - return this; - } - - /** {@inheritDoc} */ - @Override - public OnPremiseSqlResourceDetails withMachineName(String machineName) { - super.withMachineName(machineName); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (serverName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property serverName in model OnPremiseSqlResourceDetails")); - } - if (databaseName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseName in model OnPremiseSqlResourceDetails")); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.java deleted file mode 100644 index c055259f0cf1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OnboardingKind. */ -public final class OnboardingKind extends ExpandableStringEnum { - /** Static value Default for OnboardingKind. */ - public static final OnboardingKind DEFAULT = fromString("Default"); - - /** Static value MigratedToAzure for OnboardingKind. */ - public static final OnboardingKind MIGRATED_TO_AZURE = fromString("MigratedToAzure"); - - /** Static value Evaluation for OnboardingKind. */ - public static final OnboardingKind EVALUATION = fromString("Evaluation"); - - /** Static value Purchased for OnboardingKind. */ - public static final OnboardingKind PURCHASED = fromString("Purchased"); - - /** - * Creates or finds a OnboardingKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding OnboardingKind. - */ - @JsonCreator - public static OnboardingKind fromString(String name) { - return fromString(name, OnboardingKind.class); - } - - /** @return known OnboardingKind values. */ - public static Collection values() { - return values(OnboardingKind.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java index 56b27049d7da..87da4ff4a279 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ PagedIterable list(Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.java deleted file mode 100644 index ea84ae157a64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information on a specific package download. */ -@Immutable -public class PackageDownloadInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadInfo.class); - - /* - * Version number - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Download link - */ - @JsonProperty(value = "link", access = JsonProperty.Access.WRITE_ONLY) - private String link; - - /* - * Kind of the version - */ - @JsonProperty(value = "versionKind", access = JsonProperty.Access.WRITE_ONLY) - private VersionKind versionKind; - - /** - * Get the version property: Version number. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the link property: Download link. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Get the versionKind property: Kind of the version. - * - * @return the versionKind value. - */ - public VersionKind versionKind() { - return this.versionKind; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloads.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloads.java deleted file mode 100644 index f74d25932072..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloads.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import java.util.List; - -/** An immutable client-side representation of PackageDownloads. */ -public interface PackageDownloads { - /** - * Gets the sensor property: Contains all Sensor binary downloads. - * - * @return the sensor value. - */ - PackageDownloadsSensor sensor(); - - /** - * Gets the centralManager property: All downloads for Central Manager. - * - * @return the centralManager value. - */ - PackageDownloadsCentralManager centralManager(); - - /** - * Gets the threatIntelligence property: All downloads for threat intelligence. - * - * @return the threatIntelligence value. - */ - List threatIntelligence(); - - /** - * Gets the snmp property: SNMP Server file. - * - * @return the snmp value. - */ - List snmp(); - - /** - * Gets the wmiTool property: Used for local configuration export. - * - * @return the wmiTool value. - */ - List wmiTool(); - - /** - * Gets the authorizedDevicesImportTemplate property: Authorized devices import template. - * - * @return the authorizedDevicesImportTemplate value. - */ - List authorizedDevicesImportTemplate(); - - /** - * Gets the deviceInformationUpdateImportTemplate property: Authorized devices import template. - * - * @return the deviceInformationUpdateImportTemplate value. - */ - List deviceInformationUpdateImportTemplate(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner object. - * - * @return the inner object. - */ - PackageDownloadsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.java deleted file mode 100644 index 0a86e9478fec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** All downloads for Central Manager. */ -@Immutable -public final class PackageDownloadsCentralManager { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsCentralManager.class); - - /* - * Contains full package downloads - */ - @JsonProperty(value = "full", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsCentralManagerFull full; - - /* - * Central Manager upgrade package downloads (on existing installations) - */ - @JsonProperty(value = "upgrade", access = JsonProperty.Access.WRITE_ONLY) - private List upgrade; - - /** - * Get the full property: Contains full package downloads. - * - * @return the full value. - */ - public PackageDownloadsCentralManagerFull full() { - return this.full; - } - - /** - * Get the upgrade property: Central Manager upgrade package downloads (on existing installations). - * - * @return the upgrade value. - */ - public List upgrade() { - return this.upgrade; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (full() != null) { - full().validate(); - } - if (upgrade() != null) { - upgrade().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.java deleted file mode 100644 index 523de3fdd59d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains full package downloads. */ -@Immutable -public final class PackageDownloadsCentralManagerFull { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsCentralManagerFull.class); - - /* - * Contains all ISO full versions of the Central Manager - */ - @JsonProperty(value = "iso", access = JsonProperty.Access.WRITE_ONLY) - private List iso; - - /* - * Contains all OVF (virtual machine) full versions of the Central Manager - */ - @JsonProperty(value = "ovf", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsCentralManagerFullOvf ovf; - - /** - * Get the iso property: Contains all ISO full versions of the Central Manager. - * - * @return the iso value. - */ - public List iso() { - return this.iso; - } - - /** - * Get the ovf property: Contains all OVF (virtual machine) full versions of the Central Manager. - * - * @return the ovf value. - */ - public PackageDownloadsCentralManagerFullOvf ovf() { - return this.ovf; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (iso() != null) { - iso().forEach(e -> e.validate()); - } - if (ovf() != null) { - ovf().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.java deleted file mode 100644 index 662451d2b386..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains all OVF (virtual machine) full versions of the Central Manager. */ -@Immutable -public final class PackageDownloadsCentralManagerFullOvf { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsCentralManagerFullOvf.class); - - /* - * The Enterprise package type - */ - @JsonProperty(value = "enterprise", access = JsonProperty.Access.WRITE_ONLY) - private List enterprise; - - /* - * The EnterpriseHighAvailability package type - */ - @JsonProperty(value = "enterpriseHighAvailability", access = JsonProperty.Access.WRITE_ONLY) - private List enterpriseHighAvailability; - - /* - * The Medium package type - */ - @JsonProperty(value = "medium", access = JsonProperty.Access.WRITE_ONLY) - private List medium; - - /* - * The MediumHighAvailability package type - */ - @JsonProperty(value = "mediumHighAvailability", access = JsonProperty.Access.WRITE_ONLY) - private List mediumHighAvailability; - - /** - * Get the enterprise property: The Enterprise package type. - * - * @return the enterprise value. - */ - public List enterprise() { - return this.enterprise; - } - - /** - * Get the enterpriseHighAvailability property: The EnterpriseHighAvailability package type. - * - * @return the enterpriseHighAvailability value. - */ - public List enterpriseHighAvailability() { - return this.enterpriseHighAvailability; - } - - /** - * Get the medium property: The Medium package type. - * - * @return the medium value. - */ - public List medium() { - return this.medium; - } - - /** - * Get the mediumHighAvailability property: The MediumHighAvailability package type. - * - * @return the mediumHighAvailability value. - */ - public List mediumHighAvailability() { - return this.mediumHighAvailability; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enterprise() != null) { - enterprise().forEach(e -> e.validate()); - } - if (enterpriseHighAvailability() != null) { - enterpriseHighAvailability().forEach(e -> e.validate()); - } - if (medium() != null) { - medium().forEach(e -> e.validate()); - } - if (mediumHighAvailability() != null) { - mediumHighAvailability().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.java deleted file mode 100644 index 4e02e43b72a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains all Sensor binary downloads. */ -@Fluent -public final class PackageDownloadsSensor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsSensor.class); - - /* - * Contains full package downloads - */ - @JsonProperty(value = "full", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsSensorFull full; - - /* - * Sensor upgrade package downloads (on existing installations) - */ - @JsonProperty(value = "upgrade") - private List upgrade; - - /** - * Get the full property: Contains full package downloads. - * - * @return the full value. - */ - public PackageDownloadsSensorFull full() { - return this.full; - } - - /** - * Get the upgrade property: Sensor upgrade package downloads (on existing installations). - * - * @return the upgrade value. - */ - public List upgrade() { - return this.upgrade; - } - - /** - * Set the upgrade property: Sensor upgrade package downloads (on existing installations). - * - * @param upgrade the upgrade value to set. - * @return the PackageDownloadsSensor object itself. - */ - public PackageDownloadsSensor withUpgrade(List upgrade) { - this.upgrade = upgrade; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (full() != null) { - full().validate(); - } - if (upgrade() != null) { - upgrade().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.java deleted file mode 100644 index 3860b435ea80..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains full package downloads. */ -@Fluent -public final class PackageDownloadsSensorFull { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsSensorFull.class); - - /* - * Contains all ISO full versions for the sensor - */ - @JsonProperty(value = "iso", access = JsonProperty.Access.WRITE_ONLY) - private List iso; - - /* - * Contains all OVF (virtual machine) full versions for the sensor - */ - @JsonProperty(value = "ovf") - private PackageDownloadsSensorFullOvf ovf; - - /** - * Get the iso property: Contains all ISO full versions for the sensor. - * - * @return the iso value. - */ - public List iso() { - return this.iso; - } - - /** - * Get the ovf property: Contains all OVF (virtual machine) full versions for the sensor. - * - * @return the ovf value. - */ - public PackageDownloadsSensorFullOvf ovf() { - return this.ovf; - } - - /** - * Set the ovf property: Contains all OVF (virtual machine) full versions for the sensor. - * - * @param ovf the ovf value to set. - * @return the PackageDownloadsSensorFull object itself. - */ - public PackageDownloadsSensorFull withOvf(PackageDownloadsSensorFullOvf ovf) { - this.ovf = ovf; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (iso() != null) { - iso().forEach(e -> e.validate()); - } - if (ovf() != null) { - ovf().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.java deleted file mode 100644 index a002194a8de9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains all OVF (virtual machine) full versions for the sensor. */ -@Immutable -public final class PackageDownloadsSensorFullOvf { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsSensorFullOvf.class); - - /* - * Enterprise package type - */ - @JsonProperty(value = "enterprise", access = JsonProperty.Access.WRITE_ONLY) - private List enterprise; - - /* - * Medium package type - */ - @JsonProperty(value = "medium", access = JsonProperty.Access.WRITE_ONLY) - private List medium; - - /* - * Line package type - */ - @JsonProperty(value = "line", access = JsonProperty.Access.WRITE_ONLY) - private List line; - - /** - * Get the enterprise property: Enterprise package type. - * - * @return the enterprise value. - */ - public List enterprise() { - return this.enterprise; - } - - /** - * Get the medium property: Medium package type. - * - * @return the medium value. - */ - public List medium() { - return this.medium; - } - - /** - * Get the line property: Line package type. - * - * @return the line value. - */ - public List line() { - return this.line; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enterprise() != null) { - enterprise().forEach(e -> e.validate()); - } - if (medium() != null) { - medium().forEach(e -> e.validate()); - } - if (line() != null) { - line().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.java deleted file mode 100644 index fac05da58c0c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProgrammingState. */ -public final class ProgrammingState extends ExpandableStringEnum { - /** Static value ProgrammingDevice for ProgrammingState. */ - public static final ProgrammingState PROGRAMMING_DEVICE = fromString("ProgrammingDevice"); - - /** Static value NotProgrammingDevice for ProgrammingState. */ - public static final ProgrammingState NOT_PROGRAMMING_DEVICE = fromString("NotProgrammingDevice"); - - /** - * Creates or finds a ProgrammingState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProgrammingState. - */ - @JsonCreator - public static ProgrammingState fromString(String name) { - return fromString(name, ProgrammingState.class); - } - - /** @return known ProgrammingState values. */ - public static Collection values() { - return values(ProgrammingState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java index 497e6a32c476..73479667a1f8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java @@ -4,62 +4,34 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; -/** Protocol data. */ -@Fluent -public final class Protocol { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Protocol.class); +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value TCP for Protocol. */ + public static final Protocol TCP = fromString("TCP"); - /* - * Protocol name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * list of protocol identifiers. - */ - @JsonProperty(value = "identifiers") - private String identifiers; + /** Static value UDP for Protocol. */ + public static final Protocol UDP = fromString("UDP"); - /** - * Get the name property: Protocol name. - * - * @return the name value. - */ - public String name() { - return this.name; - } + /** Static value * for Protocol. */ + public static final Protocol ASTERISK = fromString("*"); /** - * Get the identifiers property: list of protocol identifiers. + * Creates or finds a Protocol from its string representation. * - * @return the identifiers value. + * @param name a name to look for. + * @return the corresponding Protocol. */ - public String identifiers() { - return this.identifiers; + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); } - /** - * Set the identifiers property: list of protocol identifiers. - * - * @param identifiers the identifiers value to set. - * @return the Protocol object itself. - */ - public Protocol withIdentifiers(String identifiers) { - this.identifiers = identifiers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.java deleted file mode 100644 index 2aa321e30d7f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProtocolValue. */ -public final class ProtocolValue extends ExpandableStringEnum { - /** Static value TCP for ProtocolValue. */ - public static final ProtocolValue TCP = fromString("TCP"); - - /** Static value UDP for ProtocolValue. */ - public static final ProtocolValue UDP = fromString("UDP"); - - /** Static value * for ProtocolValue. */ - public static final ProtocolValue ASTERISK = fromString("*"); - - /** - * Creates or finds a ProtocolValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtocolValue. - */ - @JsonCreator - public static ProtocolValue fromString(String name) { - return fromString(name, ProtocolValue.class); - } - - /** @return known ProtocolValue values. */ - public static Collection values() { - return values(ProtocolValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.java deleted file mode 100644 index 5a076100d3a3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PurdueLevel. */ -public final class PurdueLevel extends ExpandableStringEnum { - /** Static value ProcessControl for PurdueLevel. */ - public static final PurdueLevel PROCESS_CONTROL = fromString("ProcessControl"); - - /** Static value Supervisory for PurdueLevel. */ - public static final PurdueLevel SUPERVISORY = fromString("Supervisory"); - - /** Static value Enterprise for PurdueLevel. */ - public static final PurdueLevel ENTERPRISE = fromString("Enterprise"); - - /** - * Creates or finds a PurdueLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding PurdueLevel. - */ - @JsonCreator - public static PurdueLevel fromString(String name) { - return fromString(name, PurdueLevel.class); - } - - /** @return known PurdueLevel values. */ - public static Collection values() { - return values(PurdueLevel.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.java deleted file mode 100644 index fb8f34770803..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RecommendationSeverity. */ -public final class RecommendationSeverity extends ExpandableStringEnum { - /** Static value Unknown for RecommendationSeverity. */ - public static final RecommendationSeverity UNKNOWN = fromString("Unknown"); - - /** Static value NotApplicable for RecommendationSeverity. */ - public static final RecommendationSeverity NOT_APPLICABLE = fromString("NotApplicable"); - - /** Static value Healthy for RecommendationSeverity. */ - public static final RecommendationSeverity HEALTHY = fromString("Healthy"); - - /** Static value OffByPolicy for RecommendationSeverity. */ - public static final RecommendationSeverity OFF_BY_POLICY = fromString("OffByPolicy"); - - /** Static value Low for RecommendationSeverity. */ - public static final RecommendationSeverity LOW = fromString("Low"); - - /** Static value Medium for RecommendationSeverity. */ - public static final RecommendationSeverity MEDIUM = fromString("Medium"); - - /** Static value High for RecommendationSeverity. */ - public static final RecommendationSeverity HIGH = fromString("High"); - - /** - * Creates or finds a RecommendationSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendationSeverity. - */ - @JsonCreator - public static RecommendationSeverity fromString(String name) { - return fromString(name, RecommendationSeverity.class); - } - - /** @return known RecommendationSeverity values. */ - public static Collection values() { - return values(RecommendationSeverity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.java deleted file mode 100644 index 947a32eabacd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RelationToIpStatus. */ -public final class RelationToIpStatus extends ExpandableStringEnum { - /** Static value Guess for RelationToIpStatus. */ - public static final RelationToIpStatus GUESS = fromString("Guess"); - - /** Static value Certain for RelationToIpStatus. */ - public static final RelationToIpStatus CERTAIN = fromString("Certain"); - - /** - * Creates or finds a RelationToIpStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RelationToIpStatus. - */ - @JsonCreator - public static RelationToIpStatus fromString(String name) { - return fromString(name, RelationToIpStatus.class); - } - - /** @return known RelationToIpStatus values. */ - public static Collection values() { - return values(RelationToIpStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetails.java index c3c21382e212..05242e6927d8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetails.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetails.java @@ -7,23 +7,14 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** Details of the resource that was assessed. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "source", - defaultImpl = ResourceDetails.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "source") @JsonTypeName("ResourceDetails") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Azure", value = AzureResourceDetails.class), - @JsonSubTypes.Type(name = "OnPremise", value = OnPremiseResourceDetails.class) -}) @Immutable -public class ResourceDetails { +public final class ResourceDetails { @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceDetails.class); /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java index d147f9e7e6bb..2781a213080b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -27,6 +28,7 @@ public final class RulesResultsInput { * Leave this field empty it LatestScan == true. */ @JsonProperty(value = "results") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map>> results; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.java deleted file mode 100644 index ffbca2bb1750..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScanningFunctionality. */ -public final class ScanningFunctionality extends ExpandableStringEnum { - /** Static value ScannerDevice for ScanningFunctionality. */ - public static final ScanningFunctionality SCANNER_DEVICE = fromString("ScannerDevice"); - - /** Static value NotScannerDevice for ScanningFunctionality. */ - public static final ScanningFunctionality NOT_SCANNER_DEVICE = fromString("NotScannerDevice"); - - /** - * Creates or finds a ScanningFunctionality from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScanningFunctionality. - */ - @JsonCreator - public static ScanningFunctionality fromString(String name) { - return fromString(name, ScanningFunctionality.class); - } - - /** @return known ScanningFunctionality values. */ - public static Collection values() { - return values(ScanningFunctionality.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java index eb53f1d472c5..a8a48458f74a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java @@ -4,277 +4,202 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** An immutable client-side representation of SecurityAssessment. */ -public interface SecurityAssessment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. +/** Security assessment on a resource. */ +@JsonFlatten +@Fluent +public class SecurityAssessment extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessment.class); + + /* + * Details of the resource that was assessed */ - String id(); + @JsonProperty(value = "properties.resourceDetails") + private ResourceDetails resourceDetails; - /** - * Gets the name property: The name of the resource. - * - * @return the name value. + /* + * User friendly display name of the assessment + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Additional data regarding the assessment + */ + @JsonProperty(value = "properties.additionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalData; + + /* + * Links relevant to the assessment + */ + @JsonProperty(value = "properties.links", access = JsonProperty.Access.WRITE_ONLY) + private AssessmentLinks links; + + /* + * Describes properties of an assessment metadata. + */ + @JsonProperty(value = "properties.metadata") + private SecurityAssessmentMetadataProperties metadata; + + /* + * Data regarding 3rd party partner integration + */ + @JsonProperty(value = "properties.partnersData") + private SecurityAssessmentPartnerData partnersData; + + /* + * The result of the assessment */ - String name(); + @JsonProperty(value = "properties.status") + private AssessmentStatus status; /** - * Gets the type property: The type of the resource. + * Get the resourceDetails property: Details of the resource that was assessed. * - * @return the type value. + * @return the resourceDetails value. */ - String type(); + public ResourceDetails resourceDetails() { + return this.resourceDetails; + } /** - * Gets the resourceDetails property: Details of the resource that was assessed. + * Set the resourceDetails property: Details of the resource that was assessed. * - * @return the resourceDetails value. + * @param resourceDetails the resourceDetails value to set. + * @return the SecurityAssessment object itself. */ - ResourceDetails resourceDetails(); + public SecurityAssessment withResourceDetails(ResourceDetails resourceDetails) { + this.resourceDetails = resourceDetails; + return this; + } /** - * Gets the displayName property: User friendly display name of the assessment. + * Get the displayName property: User friendly display name of the assessment. * * @return the displayName value. */ - String displayName(); + public String displayName() { + return this.displayName; + } /** - * Gets the status property: The result of the assessment. + * Get the additionalData property: Additional data regarding the assessment. * - * @return the status value. + * @return the additionalData value. */ - AssessmentStatus status(); + public Map additionalData() { + return this.additionalData; + } /** - * Gets the additionalData property: Additional data regarding the assessment. + * Set the additionalData property: Additional data regarding the assessment. * - * @return the additionalData value. + * @param additionalData the additionalData value to set. + * @return the SecurityAssessment object itself. */ - Map additionalData(); + public SecurityAssessment withAdditionalData(Map additionalData) { + this.additionalData = additionalData; + return this; + } /** - * Gets the links property: Links relevant to the assessment. + * Get the links property: Links relevant to the assessment. * * @return the links value. */ - AssessmentLinks links(); + public AssessmentLinks links() { + return this.links; + } /** - * Gets the metadata property: Describes properties of an assessment metadata. + * Get the metadata property: Describes properties of an assessment metadata. * * @return the metadata value. */ - SecurityAssessmentMetadataProperties metadata(); + public SecurityAssessmentMetadataProperties metadata() { + return this.metadata; + } /** - * Gets the partnersData property: Data regarding 3rd party partner integration. + * Set the metadata property: Describes properties of an assessment metadata. * - * @return the partnersData value. + * @param metadata the metadata value to set. + * @return the SecurityAssessment object itself. */ - SecurityAssessmentPartnerData partnersData(); + public SecurityAssessment withMetadata(SecurityAssessmentMetadataProperties metadata) { + this.metadata = metadata; + return this; + } /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner object. + * Get the partnersData property: Data regarding 3rd party partner integration. * - * @return the inner object. + * @return the partnersData value. */ - SecurityAssessmentInner innerModel(); - - /** The entirety of the SecurityAssessment definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + public SecurityAssessmentPartnerData partnersData() { + return this.partnersData; } - /** The SecurityAssessment definition stages. */ - interface DefinitionStages { - /** The first stage of the SecurityAssessment definition. */ - interface Blank extends WithScope { - } - /** The stage of the SecurityAssessment definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - /** - * The stage of the SecurityAssessment definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithResourceDetails, - DefinitionStages.WithStatus, - DefinitionStages.WithAdditionalData, - DefinitionStages.WithMetadata, - DefinitionStages.WithPartnersData { - /** - * Executes the create request. - * - * @return the created resource. - */ - SecurityAssessment create(); - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SecurityAssessment create(Context context); - } - /** The stage of the SecurityAssessment definition allowing to specify resourceDetails. */ - interface WithResourceDetails { - /** - * Specifies the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails Details of the resource that was assessed. - * @return the next definition stage. - */ - WithCreate withResourceDetails(ResourceDetails resourceDetails); - } - /** The stage of the SecurityAssessment definition allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: The result of the assessment. - * - * @param status The result of the assessment. - * @return the next definition stage. - */ - WithCreate withStatus(AssessmentStatus status); - } - /** The stage of the SecurityAssessment definition allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data regarding the assessment. - * - * @param additionalData Additional data regarding the assessment. - * @return the next definition stage. - */ - WithCreate withAdditionalData(Map additionalData); - } - /** The stage of the SecurityAssessment definition allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: Describes properties of an assessment metadata.. - * - * @param metadata Describes properties of an assessment metadata. - * @return the next definition stage. - */ - WithCreate withMetadata(SecurityAssessmentMetadataProperties metadata); - } - /** The stage of the SecurityAssessment definition allowing to specify partnersData. */ - interface WithPartnersData { - /** - * Specifies the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData Data regarding 3rd party partner integration. - * @return the next definition stage. - */ - WithCreate withPartnersData(SecurityAssessmentPartnerData partnersData); - } - } /** - * Begins update for the SecurityAssessment resource. + * Set the partnersData property: Data regarding 3rd party partner integration. * - * @return the stage of resource update. + * @param partnersData the partnersData value to set. + * @return the SecurityAssessment object itself. */ - SecurityAssessment.Update update(); - - /** The template for SecurityAssessment update. */ - interface Update - extends UpdateStages.WithResourceDetails, - UpdateStages.WithStatus, - UpdateStages.WithAdditionalData, - UpdateStages.WithMetadata, - UpdateStages.WithPartnersData { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SecurityAssessment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SecurityAssessment apply(Context context); + public SecurityAssessment withPartnersData(SecurityAssessmentPartnerData partnersData) { + this.partnersData = partnersData; + return this; } - /** The SecurityAssessment update stages. */ - interface UpdateStages { - /** The stage of the SecurityAssessment update allowing to specify resourceDetails. */ - interface WithResourceDetails { - /** - * Specifies the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails Details of the resource that was assessed. - * @return the next definition stage. - */ - Update withResourceDetails(ResourceDetails resourceDetails); - } - /** The stage of the SecurityAssessment update allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: The result of the assessment. - * - * @param status The result of the assessment. - * @return the next definition stage. - */ - Update withStatus(AssessmentStatus status); - } - /** The stage of the SecurityAssessment update allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data regarding the assessment. - * - * @param additionalData Additional data regarding the assessment. - * @return the next definition stage. - */ - Update withAdditionalData(Map additionalData); - } - /** The stage of the SecurityAssessment update allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: Describes properties of an assessment metadata.. - * - * @param metadata Describes properties of an assessment metadata. - * @return the next definition stage. - */ - Update withMetadata(SecurityAssessmentMetadataProperties metadata); - } - /** The stage of the SecurityAssessment update allowing to specify partnersData. */ - interface WithPartnersData { - /** - * Specifies the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData Data regarding 3rd party partner integration. - * @return the next definition stage. - */ - Update withPartnersData(SecurityAssessmentPartnerData partnersData); - } + + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatus status() { + return this.status; } + /** - * Refreshes the resource to sync with Azure. + * Set the status property: The result of the assessment. * - * @return the refreshed resource. + * @param status the status value to set. + * @return the SecurityAssessment object itself. */ - SecurityAssessment refresh(); + public SecurityAssessment withStatus(AssessmentStatus status) { + this.status = status; + return this; + } /** - * Refreshes the resource to sync with Azure. + * Validates the instance. * - * @param context The context to associate with this operation. - * @return the refreshed resource. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - SecurityAssessment refresh(Context context); + public void validate() { + if (resourceDetails() != null) { + resourceDetails().validate(); + } + if (links() != null) { + links().validate(); + } + if (metadata() != null) { + metadata().validate(); + } + if (partnersData() != null) { + partnersData().validate(); + } + if (status() != null) { + status().validate(); + } + } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java index 3894c6814932..f1a4ed0be5e0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java @@ -6,7 +6,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -20,7 +20,7 @@ public final class SecurityAssessmentList { * Collection of security assessments in this page */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * The URI to fetch the next page. @@ -33,7 +33,7 @@ public final class SecurityAssessmentList { * * @return the value value. */ - public List value() { + public List value() { return this.value; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java index 8e2cdcf2e7fe..607bf63b3874 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java @@ -12,7 +12,7 @@ /** Describes properties of an assessment metadata. */ @Fluent -public final class SecurityAssessmentMetadataProperties { +public class SecurityAssessmentMetadataProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataProperties.class); /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponse.java new file mode 100644 index 000000000000..7fc68fbfbd22 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponse.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes properties of an assessment metadata response. */ +@Fluent +public final class SecurityAssessmentMetadataPropertiesResponse extends SecurityAssessmentMetadataProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataPropertiesResponse.class); + + /* + * The publishDates property. + */ + @JsonProperty(value = "publishDates") + private SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates; + + /* + * The plannedDeprecationDate property. + */ + @JsonProperty(value = "plannedDeprecationDate") + private String plannedDeprecationDate; + + /* + * The tactics property. + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The techniques property. + */ + @JsonProperty(value = "techniques") + private List techniques; + + /** + * Get the publishDates property: The publishDates property. + * + * @return the publishDates value. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { + return this.publishDates; + } + + /** + * Set the publishDates property: The publishDates property. + * + * @param publishDates the publishDates value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withPublishDates( + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + this.publishDates = publishDates; + return this; + } + + /** + * Get the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @return the plannedDeprecationDate value. + */ + public String plannedDeprecationDate() { + return this.plannedDeprecationDate; + } + + /** + * Set the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @param plannedDeprecationDate the plannedDeprecationDate value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withPlannedDeprecationDate(String plannedDeprecationDate) { + this.plannedDeprecationDate = plannedDeprecationDate; + return this; + } + + /** + * Get the tactics property: The tactics property. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics property. + * + * @param tactics the tactics value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the techniques property: The techniques property. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Set the techniques property: The techniques property. + * + * @param techniques the techniques value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withTechniques(List techniques) { + this.techniques = techniques; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withRemediationDescription(String remediationDescription) { + super.withRemediationDescription(remediationDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withCategories(List categories) { + super.withCategories(categories); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withSeverity(Severity severity) { + super.withSeverity(severity); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withUserImpact(UserImpact userImpact) { + super.withUserImpact(userImpact); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withImplementationEffort( + ImplementationEffort implementationEffort) { + super.withImplementationEffort(implementationEffort); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withThreats(List threats) { + super.withThreats(threats); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withPreview(Boolean preview) { + super.withPreview(preview); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withAssessmentType(AssessmentType assessmentType) { + super.withAssessmentType(assessmentType); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withPartnerData( + SecurityAssessmentMetadataPartnerData partnerData) { + super.withPartnerData(partnerData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (publishDates() != null) { + publishDates().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java new file mode 100644 index 000000000000..7b588da7dc5a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SecurityAssessmentMetadataPropertiesResponsePublishDates model. */ +@Fluent +public final class SecurityAssessmentMetadataPropertiesResponsePublishDates { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); + + /* + * The GA property. + */ + @JsonProperty(value = "GA") + private String ga; + + /* + * The public property. + */ + @JsonProperty(value = "public", required = true) + private String publicProperty; + + /** + * Get the ga property: The GA property. + * + * @return the ga value. + */ + public String ga() { + return this.ga; + } + + /** + * Set the ga property: The GA property. + * + * @param ga the ga value to set. + * @return the SecurityAssessmentMetadataPropertiesResponsePublishDates object itself. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates withGa(String ga) { + this.ga = ga; + return this; + } + + /** + * Get the publicProperty property: The public property. + * + * @return the publicProperty value. + */ + public String publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: The public property. + * + * @param publicProperty the publicProperty value to set. + * @return the SecurityAssessmentMetadataPropertiesResponsePublishDates object itself. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates withPublicProperty(String publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicProperty() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicProperty in model" + + " SecurityAssessmentMetadataPropertiesResponsePublishDates")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadata.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadata.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java index c16b0303f107..2f792b33f7c3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadata.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.security.models; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import java.util.List; -/** An immutable client-side representation of SecurityAssessmentMetadata. */ -public interface SecurityAssessmentMetadata { +/** An immutable client-side representation of SecurityAssessmentMetadataResponse. */ +public interface SecurityAssessmentMetadataResponse { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -119,23 +119,51 @@ public interface SecurityAssessmentMetadata { SecurityAssessmentMetadataPartnerData partnerData(); /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner object. + * Gets the publishDates property: The publishDates property. + * + * @return the publishDates value. + */ + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates(); + + /** + * Gets the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @return the plannedDeprecationDate value. + */ + String plannedDeprecationDate(); + + /** + * Gets the tactics property: The tactics property. + * + * @return the tactics value. + */ + List tactics(); + + /** + * Gets the techniques property: The techniques property. + * + * @return the techniques value. + */ + List techniques(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner object. * * @return the inner object. */ - SecurityAssessmentMetadataInner innerModel(); + SecurityAssessmentMetadataResponseInner innerModel(); - /** The entirety of the SecurityAssessmentMetadata definition. */ + /** The entirety of the SecurityAssessmentMetadataResponse definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } - /** The SecurityAssessmentMetadata definition stages. */ + /** The SecurityAssessmentMetadataResponse definition stages. */ interface DefinitionStages { - /** The first stage of the SecurityAssessmentMetadata definition. */ + /** The first stage of the SecurityAssessmentMetadataResponse definition. */ interface Blank extends WithCreate { } /** - * The stage of the SecurityAssessmentMetadata definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. + * The stage of the SecurityAssessmentMetadataResponse definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithDisplayName, @@ -148,13 +176,17 @@ interface WithCreate DefinitionStages.WithThreats, DefinitionStages.WithPreview, DefinitionStages.WithAssessmentType, - DefinitionStages.WithPartnerData { + DefinitionStages.WithPartnerData, + DefinitionStages.WithPublishDates, + DefinitionStages.WithPlannedDeprecationDate, + DefinitionStages.WithTactics, + DefinitionStages.WithTechniques { /** * Executes the create request. * * @return the created resource. */ - SecurityAssessmentMetadata create(); + SecurityAssessmentMetadataResponse create(); /** * Executes the create request. @@ -162,9 +194,9 @@ interface WithCreate * @param context The context to associate with this operation. * @return the created resource. */ - SecurityAssessmentMetadata create(Context context); + SecurityAssessmentMetadataResponse create(Context context); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify displayName. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify displayName. */ interface WithDisplayName { /** * Specifies the displayName property: User friendly display name of the assessment. @@ -174,7 +206,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify description. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify description. */ interface WithDescription { /** * Specifies the description property: Human readable description of the assessment. @@ -184,7 +216,9 @@ interface WithDescription { */ WithCreate withDescription(String description); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify remediationDescription. */ + /** + * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify remediationDescription. + */ interface WithRemediationDescription { /** * Specifies the remediationDescription property: Human readable description of what you should do to @@ -196,7 +230,7 @@ interface WithRemediationDescription { */ WithCreate withRemediationDescription(String remediationDescription); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify categories. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify categories. */ interface WithCategories { /** * Specifies the categories property: The categories property.. @@ -206,7 +240,7 @@ interface WithCategories { */ WithCreate withCategories(List categories); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify severity. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify severity. */ interface WithSeverity { /** * Specifies the severity property: The severity level of the assessment. @@ -216,7 +250,7 @@ interface WithSeverity { */ WithCreate withSeverity(Severity severity); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify userImpact. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify userImpact. */ interface WithUserImpact { /** * Specifies the userImpact property: The user impact of the assessment. @@ -226,7 +260,7 @@ interface WithUserImpact { */ WithCreate withUserImpact(UserImpact userImpact); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify implementationEffort. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify implementationEffort. */ interface WithImplementationEffort { /** * Specifies the implementationEffort property: The implementation effort required to remediate this @@ -237,7 +271,7 @@ interface WithImplementationEffort { */ WithCreate withImplementationEffort(ImplementationEffort implementationEffort); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify threats. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify threats. */ interface WithThreats { /** * Specifies the threats property: The threats property.. @@ -247,7 +281,7 @@ interface WithThreats { */ WithCreate withThreats(List threats); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify preview. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify preview. */ interface WithPreview { /** * Specifies the preview property: True if this assessment is in preview release status. @@ -257,7 +291,7 @@ interface WithPreview { */ WithCreate withPreview(Boolean preview); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify assessmentType. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify assessmentType. */ interface WithAssessmentType { /** * Specifies the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy @@ -269,7 +303,7 @@ interface WithAssessmentType { */ WithCreate withAssessmentType(AssessmentType assessmentType); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify partnerData. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify partnerData. */ interface WithPartnerData { /** * Specifies the partnerData property: Describes the partner that created the assessment. @@ -279,13 +313,55 @@ interface WithPartnerData { */ WithCreate withPartnerData(SecurityAssessmentMetadataPartnerData partnerData); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify publishDates. */ + interface WithPublishDates { + /** + * Specifies the publishDates property: The publishDates property.. + * + * @param publishDates The publishDates property. + * @return the next definition stage. + */ + WithCreate withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates); + } + /** + * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify plannedDeprecationDate. + */ + interface WithPlannedDeprecationDate { + /** + * Specifies the plannedDeprecationDate property: The plannedDeprecationDate property.. + * + * @param plannedDeprecationDate The plannedDeprecationDate property. + * @return the next definition stage. + */ + WithCreate withPlannedDeprecationDate(String plannedDeprecationDate); + } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify tactics. */ + interface WithTactics { + /** + * Specifies the tactics property: The tactics property.. + * + * @param tactics The tactics property. + * @return the next definition stage. + */ + WithCreate withTactics(List tactics); + } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify techniques. */ + interface WithTechniques { + /** + * Specifies the techniques property: The techniques property.. + * + * @param techniques The techniques property. + * @return the next definition stage. + */ + WithCreate withTechniques(List techniques); + } } /** * Refreshes the resource to sync with Azure. * * @return the refreshed resource. */ - SecurityAssessmentMetadata refresh(); + SecurityAssessmentMetadataResponse refresh(); /** * Refreshes the resource to sync with Azure. @@ -293,5 +369,5 @@ interface WithPartnerData { * @param context The context to associate with this operation. * @return the refreshed resource. */ - SecurityAssessmentMetadata refresh(Context context); + SecurityAssessmentMetadataResponse refresh(Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java similarity index 84% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataList.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java index a38f0c3aff36..b187348ea1e5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java @@ -6,21 +6,21 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of security assessment metadata. */ @Immutable -public final class SecurityAssessmentMetadataList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataList.class); +public final class SecurityAssessmentMetadataResponseList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataResponseList.class); /* * The value property. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * The URI to fetch the next page. @@ -33,7 +33,7 @@ public final class SecurityAssessmentMetadataList { * * @return the value value. */ - public List value() { + public List value() { return this.value; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentProperties.java new file mode 100644 index 000000000000..f8e63cab244f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes properties of an assessment. */ +@Fluent +public final class SecurityAssessmentProperties extends SecurityAssessmentPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentProperties.class); + + /* + * The result of the assessment + */ + @JsonProperty(value = "status", required = true) + private AssessmentStatus status; + + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatus status() { + return this.status; + } + + /** + * Set the status property: The result of the assessment. + * + * @param status the status value to set. + * @return the SecurityAssessmentProperties object itself. + */ + public SecurityAssessmentProperties withStatus(AssessmentStatus status) { + this.status = status; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withResourceDetails(ResourceDetails resourceDetails) { + super.withResourceDetails(resourceDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withAdditionalData(Map additionalData) { + super.withAdditionalData(additionalData); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withMetadata(SecurityAssessmentMetadataProperties metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withPartnersData(SecurityAssessmentPartnerData partnersData) { + super.withPartnersData(partnersData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model SecurityAssessmentProperties")); + } else { + status().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java new file mode 100644 index 000000000000..e07b19a8f1d8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes properties of an assessment. */ +@Fluent +public class SecurityAssessmentPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentPropertiesBase.class); + + /* + * Details of the resource that was assessed + */ + @JsonProperty(value = "resourceDetails", required = true) + private ResourceDetails resourceDetails; + + /* + * User friendly display name of the assessment + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Additional data regarding the assessment + */ + @JsonProperty(value = "additionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalData; + + /* + * Links relevant to the assessment + */ + @JsonProperty(value = "links", access = JsonProperty.Access.WRITE_ONLY) + private AssessmentLinks links; + + /* + * Describes properties of an assessment metadata. + */ + @JsonProperty(value = "metadata") + private SecurityAssessmentMetadataProperties metadata; + + /* + * Data regarding 3rd party partner integration + */ + @JsonProperty(value = "partnersData") + private SecurityAssessmentPartnerData partnersData; + + /** + * 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 SecurityAssessmentPropertiesBase object itself. + */ + public SecurityAssessmentPropertiesBase withResourceDetails(ResourceDetails resourceDetails) { + this.resourceDetails = resourceDetails; + return this; + } + + /** + * Get the displayName property: User friendly display name of the assessment. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the additionalData property: Additional data regarding the assessment. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: Additional data regarding the assessment. + * + * @param additionalData the additionalData value to set. + * @return the SecurityAssessmentPropertiesBase object itself. + */ + public SecurityAssessmentPropertiesBase withAdditionalData(Map additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get the links property: Links relevant to the assessment. + * + * @return the links value. + */ + public AssessmentLinks links() { + return this.links; + } + + /** + * Get the metadata property: Describes properties of an assessment metadata. + * + * @return the metadata value. + */ + public SecurityAssessmentMetadataProperties metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Describes properties of an assessment metadata. + * + * @param metadata the metadata value to set. + * @return the SecurityAssessmentPropertiesBase object itself. + */ + public SecurityAssessmentPropertiesBase withMetadata(SecurityAssessmentMetadataProperties metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the partnersData property: Data regarding 3rd party partner integration. + * + * @return the partnersData value. + */ + public SecurityAssessmentPartnerData partnersData() { + return this.partnersData; + } + + /** + * Set the partnersData property: Data regarding 3rd party partner integration. + * + * @param partnersData the partnersData value to set. + * @return the SecurityAssessmentPropertiesBase object itself. + */ + public SecurityAssessmentPropertiesBase withPartnersData(SecurityAssessmentPartnerData partnersData) { + this.partnersData = partnersData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceDetails() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceDetails in model SecurityAssessmentPropertiesBase")); + } else { + resourceDetails().validate(); + } + if (links() != null) { + links().validate(); + } + if (metadata() != null) { + metadata().validate(); + } + if (partnersData() != null) { + partnersData().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesResponse.java new file mode 100644 index 000000000000..d652418d4be4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesResponse.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes properties of an assessment. */ +@Fluent +public final class SecurityAssessmentPropertiesResponse extends SecurityAssessmentPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentPropertiesResponse.class); + + /* + * The result of the assessment + */ + @JsonProperty(value = "status", required = true) + private AssessmentStatusResponse status; + + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatusResponse status() { + return this.status; + } + + /** + * Set the status property: The result of the assessment. + * + * @param status the status value to set. + * @return the SecurityAssessmentPropertiesResponse object itself. + */ + public SecurityAssessmentPropertiesResponse withStatus(AssessmentStatusResponse status) { + this.status = status; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withResourceDetails(ResourceDetails resourceDetails) { + super.withResourceDetails(resourceDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withAdditionalData(Map additionalData) { + super.withAdditionalData(additionalData); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withMetadata(SecurityAssessmentMetadataProperties metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withPartnersData(SecurityAssessmentPartnerData partnersData) { + super.withPartnersData(partnersData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model SecurityAssessmentPropertiesResponse")); + } else { + status().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java new file mode 100644 index 000000000000..0da68783eb86 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; +import java.util.Map; + +/** An immutable client-side representation of SecurityAssessmentResponse. */ +public interface SecurityAssessmentResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceDetails property: Details of the resource that was assessed. + * + * @return the resourceDetails value. + */ + ResourceDetails resourceDetails(); + + /** + * Gets the displayName property: User friendly display name of the assessment. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the additionalData property: Additional data regarding the assessment. + * + * @return the additionalData value. + */ + Map additionalData(); + + /** + * Gets the links property: Links relevant to the assessment. + * + * @return the links value. + */ + AssessmentLinks links(); + + /** + * Gets the metadata property: Describes properties of an assessment metadata. + * + * @return the metadata value. + */ + SecurityAssessmentMetadataProperties metadata(); + + /** + * Gets the partnersData property: Data regarding 3rd party partner integration. + * + * @return the partnersData value. + */ + SecurityAssessmentPartnerData partnersData(); + + /** + * Gets the status property: The result of the assessment. + * + * @return the status value. + */ + AssessmentStatusResponse status(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner object. + * + * @return the inner object. + */ + SecurityAssessmentResponseInner innerModel(); + + /** The entirety of the SecurityAssessmentResponse definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + /** The SecurityAssessmentResponse definition stages. */ + interface DefinitionStages { + /** The first stage of the SecurityAssessmentResponse definition. */ + interface Blank extends WithScope { + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies resourceId. + * + * @param resourceId The identifier of the resource. + * @return the next definition stage. + */ + WithCreate withExistingResourceId(String resourceId); + } + /** + * The stage of the SecurityAssessmentResponse definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithResourceDetails, + DefinitionStages.WithAdditionalData, + DefinitionStages.WithMetadata, + DefinitionStages.WithPartnersData, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityAssessmentResponse create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityAssessmentResponse create(Context context); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify resourceDetails. */ + interface WithResourceDetails { + /** + * Specifies the resourceDetails property: Details of the resource that was assessed. + * + * @param resourceDetails Details of the resource that was assessed. + * @return the next definition stage. + */ + WithCreate withResourceDetails(ResourceDetails resourceDetails); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify additionalData. */ + interface WithAdditionalData { + /** + * Specifies the additionalData property: Additional data regarding the assessment. + * + * @param additionalData Additional data regarding the assessment. + * @return the next definition stage. + */ + WithCreate withAdditionalData(Map additionalData); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Describes properties of an assessment metadata.. + * + * @param metadata Describes properties of an assessment metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(SecurityAssessmentMetadataProperties metadata); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify partnersData. */ + interface WithPartnersData { + /** + * Specifies the partnersData property: Data regarding 3rd party partner integration. + * + * @param partnersData Data regarding 3rd party partner integration. + * @return the next definition stage. + */ + WithCreate withPartnersData(SecurityAssessmentPartnerData partnersData); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The result of the assessment. + * + * @param status The result of the assessment. + * @return the next definition stage. + */ + WithCreate withStatus(AssessmentStatus status); + } + } + /** + * Begins update for the SecurityAssessmentResponse resource. + * + * @return the stage of resource update. + */ + SecurityAssessmentResponse.Update update(); + + /** The template for SecurityAssessmentResponse update. */ + interface Update + extends UpdateStages.WithResourceDetails, + UpdateStages.WithAdditionalData, + UpdateStages.WithMetadata, + UpdateStages.WithPartnersData, + UpdateStages.WithStatus { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityAssessmentResponse apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityAssessmentResponse apply(Context context); + } + /** The SecurityAssessmentResponse update stages. */ + interface UpdateStages { + /** The stage of the SecurityAssessmentResponse update allowing to specify resourceDetails. */ + interface WithResourceDetails { + /** + * Specifies the resourceDetails property: Details of the resource that was assessed. + * + * @param resourceDetails Details of the resource that was assessed. + * @return the next definition stage. + */ + Update withResourceDetails(ResourceDetails resourceDetails); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify additionalData. */ + interface WithAdditionalData { + /** + * Specifies the additionalData property: Additional data regarding the assessment. + * + * @param additionalData Additional data regarding the assessment. + * @return the next definition stage. + */ + Update withAdditionalData(Map additionalData); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Describes properties of an assessment metadata.. + * + * @param metadata Describes properties of an assessment metadata. + * @return the next definition stage. + */ + Update withMetadata(SecurityAssessmentMetadataProperties metadata); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify partnersData. */ + interface WithPartnersData { + /** + * Specifies the partnersData property: Data regarding 3rd party partner integration. + * + * @param partnersData Data regarding 3rd party partner integration. + * @return the next definition stage. + */ + Update withPartnersData(SecurityAssessmentPartnerData partnersData); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The result of the assessment. + * + * @param status The result of the assessment. + * @return the next definition stage. + */ + Update withStatus(AssessmentStatus status); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityAssessmentResponse refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityAssessmentResponse refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.java deleted file mode 100644 index 466b9593cf6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Sensor data. */ -@Immutable -public final class Sensor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sensor.class); - - /* - * Sensor name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Zone Name. - */ - @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) - private String zone; - - /** - * Get the name property: Sensor name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the zone property: Zone Name. - * - * @return the zone value. - */ - public String zone() { - return this.zone; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorStatus.java deleted file mode 100644 index bfddff37d516..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SensorStatus. */ -public final class SensorStatus extends ExpandableStringEnum { - /** Static value Ok for SensorStatus. */ - public static final SensorStatus OK = fromString("Ok"); - - /** Static value Disconnected for SensorStatus. */ - public static final SensorStatus DISCONNECTED = fromString("Disconnected"); - - /** Static value Unavailable for SensorStatus. */ - public static final SensorStatus UNAVAILABLE = fromString("Unavailable"); - - /** - * Creates or finds a SensorStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding SensorStatus. - */ - @JsonCreator - public static SensorStatus fromString(String name) { - return fromString(name, SensorStatus.class); - } - - /** @return known SensorStatus values. */ - public static Collection values() { - return values(SensorStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.java deleted file mode 100644 index b500d0c1bd7b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SensorType. */ -public final class SensorType extends ExpandableStringEnum { - /** Static value Ot for SensorType. */ - public static final SensorType OT = fromString("Ot"); - - /** Static value Enterprise for SensorType. */ - public static final SensorType ENTERPRISE = fromString("Enterprise"); - - /** - * Creates or finds a SensorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SensorType. - */ - @JsonCreator - public static SensorType fromString(String name) { - return fromString(name, SensorType.class); - } - - /** @return known SensorType values. */ - public static Collection values() { - return values(SensorType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java index 8ff2556b1283..d2d1eaf1ba99 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -32,6 +33,7 @@ public final class ServerVulnerabilityProperties extends AdditionalData { * Dictionary from cvss version to cvss details object */ @JsonProperty(value = "cvss", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map cvss; /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java index 4660a0cb49d9..fa367d46a61a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java @@ -16,6 +16,10 @@ public final class SettingsSettingName extends ExpandableStringEnum { + /** Static value High for SeverityEnum. */ + public static final SeverityEnum HIGH = fromString("High"); + + /** Static value Medium for SeverityEnum. */ + public static final SeverityEnum MEDIUM = fromString("Medium"); + + /** Static value Low for SeverityEnum. */ + public static final SeverityEnum LOW = fromString("Low"); + + /** + * Creates or finds a SeverityEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SeverityEnum. + */ + @JsonCreator + public static SeverityEnum fromString(String name) { + return fromString(name, SeverityEnum.class); + } + + /** @return known SeverityEnum values. */ + public static Collection values() { + return values(SeverityEnum.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.java deleted file mode 100644 index 6d4491aa7c59..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Site data. */ -@Immutable -public final class Site { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Site.class); - - /* - * Site display name - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /** - * Get the displayName property: Site display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java new file mode 100644 index 000000000000..8fe5dba765e9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SupportedCloudEnum. */ +public final class SupportedCloudEnum extends ExpandableStringEnum { + /** Static value AWS for SupportedCloudEnum. */ + public static final SupportedCloudEnum AWS = fromString("AWS"); + + /** + * Creates or finds a SupportedCloudEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportedCloudEnum. + */ + @JsonCreator + public static SupportedCloudEnum fromString(String name) { + return fromString(name, SupportedCloudEnum.class); + } + + /** @return known SupportedCloudEnum values. */ + public static Collection values() { + return values(SupportedCloudEnum.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java new file mode 100644 index 000000000000..41d0654fa3a4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Tactics. */ +public final class Tactics extends ExpandableStringEnum { + /** Static value Reconnaissance for Tactics. */ + public static final Tactics RECONNAISSANCE = fromString("Reconnaissance"); + + /** Static value Resource Development for Tactics. */ + public static final Tactics RESOURCE_DEVELOPMENT = fromString("Resource Development"); + + /** Static value Initial Access for Tactics. */ + public static final Tactics INITIAL_ACCESS = fromString("Initial Access"); + + /** Static value Execution for Tactics. */ + public static final Tactics EXECUTION = fromString("Execution"); + + /** Static value Persistence for Tactics. */ + public static final Tactics PERSISTENCE = fromString("Persistence"); + + /** Static value Privilege Escalation for Tactics. */ + public static final Tactics PRIVILEGE_ESCALATION = fromString("Privilege Escalation"); + + /** Static value Defense Evasion for Tactics. */ + public static final Tactics DEFENSE_EVASION = fromString("Defense Evasion"); + + /** Static value Credential Access for Tactics. */ + public static final Tactics CREDENTIAL_ACCESS = fromString("Credential Access"); + + /** Static value Discovery for Tactics. */ + public static final Tactics DISCOVERY = fromString("Discovery"); + + /** Static value Lateral Movement for Tactics. */ + public static final Tactics LATERAL_MOVEMENT = fromString("Lateral Movement"); + + /** Static value Collection for Tactics. */ + public static final Tactics COLLECTION = fromString("Collection"); + + /** Static value Command and Control for Tactics. */ + public static final Tactics COMMAND_AND_CONTROL = fromString("Command and Control"); + + /** Static value Exfiltration for Tactics. */ + public static final Tactics EXFILTRATION = fromString("Exfiltration"); + + /** Static value Impact for Tactics. */ + public static final Tactics IMPACT = fromString("Impact"); + + /** + * Creates or finds a Tactics from its string representation. + * + * @param name a name to look for. + * @return the corresponding Tactics. + */ + @JsonCreator + public static Tactics fromString(String name) { + return fromString(name, Tactics.class); + } + + /** @return known Tactics values. */ + public static Collection values() { + return values(Tactics.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java index a9c96a8649d3..498ad6e3ebf7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public class Tags { * A list of key value pairs that describe the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java index e9d9dedf0fe3..eabc7a645a52 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public class TagsResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java new file mode 100644 index 000000000000..7f935b7f054e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Techniques. */ +public final class Techniques extends ExpandableStringEnum { + /** Static value Abuse Elevation Control Mechanism for Techniques. */ + public static final Techniques ABUSE_ELEVATION_CONTROL_MECHANISM = fromString("Abuse Elevation Control Mechanism"); + + /** Static value Access Token Manipulation for Techniques. */ + public static final Techniques ACCESS_TOKEN_MANIPULATION = fromString("Access Token Manipulation"); + + /** Static value Account Discovery for Techniques. */ + public static final Techniques ACCOUNT_DISCOVERY = fromString("Account Discovery"); + + /** Static value Account Manipulation for Techniques. */ + public static final Techniques ACCOUNT_MANIPULATION = fromString("Account Manipulation"); + + /** Static value Active Scanning for Techniques. */ + public static final Techniques ACTIVE_SCANNING = fromString("Active Scanning"); + + /** Static value Application Layer Protocol for Techniques. */ + public static final Techniques APPLICATION_LAYER_PROTOCOL = fromString("Application Layer Protocol"); + + /** Static value Audio Capture for Techniques. */ + public static final Techniques AUDIO_CAPTURE = fromString("Audio Capture"); + + /** Static value Boot or Logon Autostart Execution for Techniques. */ + public static final Techniques BOOT_OR_LOGON_AUTOSTART_EXECUTION = fromString("Boot or Logon Autostart Execution"); + + /** Static value Boot or Logon Initialization Scripts for Techniques. */ + public static final Techniques BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = + fromString("Boot or Logon Initialization Scripts"); + + /** Static value Brute Force for Techniques. */ + public static final Techniques BRUTE_FORCE = fromString("Brute Force"); + + /** Static value Cloud Infrastructure Discovery for Techniques. */ + public static final Techniques CLOUD_INFRASTRUCTURE_DISCOVERY = fromString("Cloud Infrastructure Discovery"); + + /** Static value Cloud Service Dashboard for Techniques. */ + public static final Techniques CLOUD_SERVICE_DASHBOARD = fromString("Cloud Service Dashboard"); + + /** Static value Cloud Service Discovery for Techniques. */ + public static final Techniques CLOUD_SERVICE_DISCOVERY = fromString("Cloud Service Discovery"); + + /** Static value Command and Scripting Interpreter for Techniques. */ + public static final Techniques COMMAND_AND_SCRIPTING_INTERPRETER = fromString("Command and Scripting Interpreter"); + + /** Static value Compromise Client Software Binary for Techniques. */ + public static final Techniques COMPROMISE_CLIENT_SOFTWARE_BINARY = fromString("Compromise Client Software Binary"); + + /** Static value Compromise Infrastructure for Techniques. */ + public static final Techniques COMPROMISE_INFRASTRUCTURE = fromString("Compromise Infrastructure"); + + /** Static value Container and Resource Discovery for Techniques. */ + public static final Techniques CONTAINER_AND_RESOURCE_DISCOVERY = fromString("Container and Resource Discovery"); + + /** Static value Create Account for Techniques. */ + public static final Techniques CREATE_ACCOUNT = fromString("Create Account"); + + /** Static value Create or Modify System Process for Techniques. */ + public static final Techniques CREATE_OR_MODIFY_SYSTEM_PROCESS = fromString("Create or Modify System Process"); + + /** Static value Credentials from Password Stores for Techniques. */ + public static final Techniques CREDENTIALS_FROM_PASSWORD_STORES = fromString("Credentials from Password Stores"); + + /** Static value Data Destruction for Techniques. */ + public static final Techniques DATA_DESTRUCTION = fromString("Data Destruction"); + + /** Static value Data Encrypted for Impact for Techniques. */ + public static final Techniques DATA_ENCRYPTED_FOR_IMPACT = fromString("Data Encrypted for Impact"); + + /** Static value Data from Cloud Storage Object for Techniques. */ + public static final Techniques DATA_FROM_CLOUD_STORAGE_OBJECT = fromString("Data from Cloud Storage Object"); + + /** Static value Data from Configuration Repository for Techniques. */ + public static final Techniques DATA_FROM_CONFIGURATION_REPOSITORY = + fromString("Data from Configuration Repository"); + + /** Static value Data from Information Repositories for Techniques. */ + public static final Techniques DATA_FROM_INFORMATION_REPOSITORIES = + fromString("Data from Information Repositories"); + + /** Static value Data from Local System for Techniques. */ + public static final Techniques DATA_FROM_LOCAL_SYSTEM = fromString("Data from Local System"); + + /** Static value Data Manipulation for Techniques. */ + public static final Techniques DATA_MANIPULATION = fromString("Data Manipulation"); + + /** Static value Data Staged for Techniques. */ + public static final Techniques DATA_STAGED = fromString("Data Staged"); + + /** Static value Defacement for Techniques. */ + public static final Techniques DEFACEMENT = fromString("Defacement"); + + /** Static value Deobfuscate/Decode Files or Information for Techniques. */ + public static final Techniques DEOBFUSCATE_DECODE_FILES_OR_INFORMATION = + fromString("Deobfuscate/Decode Files or Information"); + + /** Static value Disk Wipe for Techniques. */ + public static final Techniques DISK_WIPE = fromString("Disk Wipe"); + + /** Static value Domain Trust Discovery for Techniques. */ + public static final Techniques DOMAIN_TRUST_DISCOVERY = fromString("Domain Trust Discovery"); + + /** Static value Drive-by Compromise for Techniques. */ + public static final Techniques DRIVE_BY_COMPROMISE = fromString("Drive-by Compromise"); + + /** Static value Dynamic Resolution for Techniques. */ + public static final Techniques DYNAMIC_RESOLUTION = fromString("Dynamic Resolution"); + + /** Static value Endpoint Denial of Service for Techniques. */ + public static final Techniques ENDPOINT_DENIAL_OF_SERVICE = fromString("Endpoint Denial of Service"); + + /** Static value Event Triggered Execution for Techniques. */ + public static final Techniques EVENT_TRIGGERED_EXECUTION = fromString("Event Triggered Execution"); + + /** Static value Exfiltration Over Alternative Protocol for Techniques. */ + public static final Techniques EXFILTRATION_OVER_ALTERNATIVE_PROTOCOL = + fromString("Exfiltration Over Alternative Protocol"); + + /** Static value Exploit Public-Facing Application for Techniques. */ + public static final Techniques EXPLOIT_PUBLIC_FACING_APPLICATION = fromString("Exploit Public-Facing Application"); + + /** Static value Exploitation for Client Execution for Techniques. */ + public static final Techniques EXPLOITATION_FOR_CLIENT_EXECUTION = fromString("Exploitation for Client Execution"); + + /** Static value Exploitation for Credential Access for Techniques. */ + public static final Techniques EXPLOITATION_FOR_CREDENTIAL_ACCESS = + fromString("Exploitation for Credential Access"); + + /** Static value Exploitation for Defense Evasion for Techniques. */ + public static final Techniques EXPLOITATION_FOR_DEFENSE_EVASION = fromString("Exploitation for Defense Evasion"); + + /** Static value Exploitation for Privilege Escalation for Techniques. */ + public static final Techniques EXPLOITATION_FOR_PRIVILEGE_ESCALATION = + fromString("Exploitation for Privilege Escalation"); + + /** Static value Exploitation of Remote Services for Techniques. */ + public static final Techniques EXPLOITATION_OF_REMOTE_SERVICES = fromString("Exploitation of Remote Services"); + + /** Static value External Remote Services for Techniques. */ + public static final Techniques EXTERNAL_REMOTE_SERVICES = fromString("External Remote Services"); + + /** Static value Fallback Channels for Techniques. */ + public static final Techniques FALLBACK_CHANNELS = fromString("Fallback Channels"); + + /** Static value File and Directory Discovery for Techniques. */ + public static final Techniques FILE_AND_DIRECTORY_DISCOVERY = fromString("File and Directory Discovery"); + + /** Static value Gather Victim Network Information for Techniques. */ + public static final Techniques GATHER_VICTIM_NETWORK_INFORMATION = fromString("Gather Victim Network Information"); + + /** Static value Hide Artifacts for Techniques. */ + public static final Techniques HIDE_ARTIFACTS = fromString("Hide Artifacts"); + + /** Static value Hijack Execution Flow for Techniques. */ + public static final Techniques HIJACK_EXECUTION_FLOW = fromString("Hijack Execution Flow"); + + /** Static value Impair Defenses for Techniques. */ + public static final Techniques IMPAIR_DEFENSES = fromString("Impair Defenses"); + + /** Static value Implant Container Image for Techniques. */ + public static final Techniques IMPLANT_CONTAINER_IMAGE = fromString("Implant Container Image"); + + /** Static value Indicator Removal on Host for Techniques. */ + public static final Techniques INDICATOR_REMOVAL_ON_HOST = fromString("Indicator Removal on Host"); + + /** Static value Indirect Command Execution for Techniques. */ + public static final Techniques INDIRECT_COMMAND_EXECUTION = fromString("Indirect Command Execution"); + + /** Static value Ingress Tool Transfer for Techniques. */ + public static final Techniques INGRESS_TOOL_TRANSFER = fromString("Ingress Tool Transfer"); + + /** Static value Input Capture for Techniques. */ + public static final Techniques INPUT_CAPTURE = fromString("Input Capture"); + + /** Static value Inter-Process Communication for Techniques. */ + public static final Techniques INTER_PROCESS_COMMUNICATION = fromString("Inter-Process Communication"); + + /** Static value Lateral Tool Transfer for Techniques. */ + public static final Techniques LATERAL_TOOL_TRANSFER = fromString("Lateral Tool Transfer"); + + /** Static value Man-in-the-Middle for Techniques. */ + public static final Techniques MAN_IN_THE_MIDDLE = fromString("Man-in-the-Middle"); + + /** Static value Masquerading for Techniques. */ + public static final Techniques MASQUERADING = fromString("Masquerading"); + + /** Static value Modify Authentication Process for Techniques. */ + public static final Techniques MODIFY_AUTHENTICATION_PROCESS = fromString("Modify Authentication Process"); + + /** Static value Modify Registry for Techniques. */ + public static final Techniques MODIFY_REGISTRY = fromString("Modify Registry"); + + /** Static value Network Denial of Service for Techniques. */ + public static final Techniques NETWORK_DENIAL_OF_SERVICE = fromString("Network Denial of Service"); + + /** Static value Network Service Scanning for Techniques. */ + public static final Techniques NETWORK_SERVICE_SCANNING = fromString("Network Service Scanning"); + + /** Static value Network Sniffing for Techniques. */ + public static final Techniques NETWORK_SNIFFING = fromString("Network Sniffing"); + + /** Static value Non-Application Layer Protocol for Techniques. */ + public static final Techniques NON_APPLICATION_LAYER_PROTOCOL = fromString("Non-Application Layer Protocol"); + + /** Static value Non-Standard Port for Techniques. */ + public static final Techniques NON_STANDARD_PORT = fromString("Non-Standard Port"); + + /** Static value Obfuscated Files or Information for Techniques. */ + public static final Techniques OBFUSCATED_FILES_OR_INFORMATION = fromString("Obfuscated Files or Information"); + + /** Static value Obtain Capabilities for Techniques. */ + public static final Techniques OBTAIN_CAPABILITIES = fromString("Obtain Capabilities"); + + /** Static value Obuscated Files or Information for Techniques. */ + public static final Techniques OBUSCATED_FILES_OR_INFORMATION = fromString("Obuscated Files or Information"); + + /** Static value Office Application Startup for Techniques. */ + public static final Techniques OFFICE_APPLICATION_STARTUP = fromString("Office Application Startup"); + + /** Static value OS Credential Dumping for Techniques. */ + public static final Techniques OS_CREDENTIAL_DUMPING = fromString("OS Credential Dumping"); + + /** Static value Permission Groups Discovery for Techniques. */ + public static final Techniques PERMISSION_GROUPS_DISCOVERY = fromString("Permission Groups Discovery"); + + /** Static value Phishing for Techniques. */ + public static final Techniques PHISHING = fromString("Phishing"); + + /** Static value Pre-OS Boot for Techniques. */ + public static final Techniques PRE_OS_BOOT = fromString("Pre-OS Boot"); + + /** Static value Process Discovery for Techniques. */ + public static final Techniques PROCESS_DISCOVERY = fromString("Process Discovery"); + + /** Static value Process Injection for Techniques. */ + public static final Techniques PROCESS_INJECTION = fromString("Process Injection"); + + /** Static value Protocol Tunneling for Techniques. */ + public static final Techniques PROTOCOL_TUNNELING = fromString("Protocol Tunneling"); + + /** Static value Proxy for Techniques. */ + public static final Techniques PROXY = fromString("Proxy"); + + /** Static value Query Registry for Techniques. */ + public static final Techniques QUERY_REGISTRY = fromString("Query Registry"); + + /** Static value Remote Access Software for Techniques. */ + public static final Techniques REMOTE_ACCESS_SOFTWARE = fromString("Remote Access Software"); + + /** Static value Remote Service Session Hijacking for Techniques. */ + public static final Techniques REMOTE_SERVICE_SESSION_HIJACKING = fromString("Remote Service Session Hijacking"); + + /** Static value Remote Services for Techniques. */ + public static final Techniques REMOTE_SERVICES = fromString("Remote Services"); + + /** Static value Remote System Discovery for Techniques. */ + public static final Techniques REMOTE_SYSTEM_DISCOVERY = fromString("Remote System Discovery"); + + /** Static value Resource Hijacking for Techniques. */ + public static final Techniques RESOURCE_HIJACKING = fromString("Resource Hijacking"); + + /** Static value Scheduled Task/Job for Techniques. */ + public static final Techniques SCHEDULED_TASK_JOB = fromString("Scheduled Task/Job"); + + /** Static value Screen Capture for Techniques. */ + public static final Techniques SCREEN_CAPTURE = fromString("Screen Capture"); + + /** Static value Search Victim-Owned Websites for Techniques. */ + public static final Techniques SEARCH_VICTIM_OWNED_WEBSITES = fromString("Search Victim-Owned Websites"); + + /** Static value Server Software Component for Techniques. */ + public static final Techniques SERVER_SOFTWARE_COMPONENT = fromString("Server Software Component"); + + /** Static value Service Stop for Techniques. */ + public static final Techniques SERVICE_STOP = fromString("Service Stop"); + + /** Static value Signed Binary Proxy Execution for Techniques. */ + public static final Techniques SIGNED_BINARY_PROXY_EXECUTION = fromString("Signed Binary Proxy Execution"); + + /** Static value Software Deployment Tools for Techniques. */ + public static final Techniques SOFTWARE_DEPLOYMENT_TOOLS = fromString("Software Deployment Tools"); + + /** Static value SQL Stored Procedures for Techniques. */ + public static final Techniques SQL_STORED_PROCEDURES = fromString("SQL Stored Procedures"); + + /** Static value Steal or Forge Kerberos Tickets for Techniques. */ + public static final Techniques STEAL_OR_FORGE_KERBEROS_TICKETS = fromString("Steal or Forge Kerberos Tickets"); + + /** Static value Subvert Trust Controls for Techniques. */ + public static final Techniques SUBVERT_TRUST_CONTROLS = fromString("Subvert Trust Controls"); + + /** Static value Supply Chain Compromise for Techniques. */ + public static final Techniques SUPPLY_CHAIN_COMPROMISE = fromString("Supply Chain Compromise"); + + /** Static value System Information Discovery for Techniques. */ + public static final Techniques SYSTEM_INFORMATION_DISCOVERY = fromString("System Information Discovery"); + + /** Static value Taint Shared Content for Techniques. */ + public static final Techniques TAINT_SHARED_CONTENT = fromString("Taint Shared Content"); + + /** Static value Traffic Signaling for Techniques. */ + public static final Techniques TRAFFIC_SIGNALING = fromString("Traffic Signaling"); + + /** Static value Transfer Data to Cloud Account for Techniques. */ + public static final Techniques TRANSFER_DATA_TO_CLOUD_ACCOUNT = fromString("Transfer Data to Cloud Account"); + + /** Static value Trusted Relationship for Techniques. */ + public static final Techniques TRUSTED_RELATIONSHIP = fromString("Trusted Relationship"); + + /** Static value Unsecured Credentials for Techniques. */ + public static final Techniques UNSECURED_CREDENTIALS = fromString("Unsecured Credentials"); + + /** Static value User Execution for Techniques. */ + public static final Techniques USER_EXECUTION = fromString("User Execution"); + + /** Static value Valid Accounts for Techniques. */ + public static final Techniques VALID_ACCOUNTS = fromString("Valid Accounts"); + + /** Static value Windows Management Instrumentation for Techniques. */ + public static final Techniques WINDOWS_MANAGEMENT_INSTRUMENTATION = + fromString("Windows Management Instrumentation"); + + /** Static value File and Directory Permissions Modification for Techniques. */ + public static final Techniques FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = + fromString("File and Directory Permissions Modification"); + + /** + * Creates or finds a Techniques from its string representation. + * + * @param name a name to look for. + * @return the corresponding Techniques. + */ + @JsonCreator + public static Techniques fromString(String name) { + return fromString(name, Techniques.class); + } + + /** @return known Techniques values. */ + public static Collection values() { + return values(Techniques.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.java deleted file mode 100644 index 0d3223148878..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TiStatus. */ -public final class TiStatus extends ExpandableStringEnum { - /** Static value Ok for TiStatus. */ - public static final TiStatus OK = fromString("Ok"); - - /** Static value Failed for TiStatus. */ - public static final TiStatus FAILED = fromString("Failed"); - - /** Static value InProgress for TiStatus. */ - public static final TiStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value UpdateAvailable for TiStatus. */ - public static final TiStatus UPDATE_AVAILABLE = fromString("UpdateAvailable"); - - /** - * Creates or finds a TiStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TiStatus. - */ - @JsonCreator - public static TiStatus fromString(String name) { - return fromString(name, TiStatus.class); - } - - /** @return known TiStatus values. */ - public static Collection values() { - return values(TiStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java index 4d48619621c0..25f7bb80f813 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java @@ -8,6 +8,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -39,6 +40,7 @@ public final class TrackedResource extends ProxyResource { * A list of key value pairs that describe the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.java deleted file mode 100644 index db2cd7bf0f18..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information on a specific package upgrade download. */ -@Immutable -public final class UpgradePackageDownloadInfo extends PackageDownloadInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradePackageDownloadInfo.class); - - /* - * Minimum base version for upgrade - */ - @JsonProperty(value = "fromVersion", access = JsonProperty.Access.WRITE_ONLY) - private String fromVersion; - - /** - * Get the fromVersion property: Minimum base version for upgrade. - * - * @return the fromVersion value. - */ - public String fromVersion() { - return this.fromVersion; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.java deleted file mode 100644 index d367dff7a628..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VersionKind. */ -public final class VersionKind extends ExpandableStringEnum { - /** Static value Latest for VersionKind. */ - public static final VersionKind LATEST = fromString("Latest"); - - /** Static value Previous for VersionKind. */ - public static final VersionKind PREVIOUS = fromString("Previous"); - - /** Static value Preview for VersionKind. */ - public static final VersionKind PREVIEW = fromString("Preview"); - - /** - * Creates or finds a VersionKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding VersionKind. - */ - @JsonCreator - public static VersionKind fromString(String name) { - return fromString(name, VersionKind.class); - } - - /** @return known VersionKind values. */ - public static Collection values() { - return values(VersionKind.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java deleted file mode 100644 index 6435ef904f05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveApplicationControls Delete. */ -public final class AdaptiveApplicationControlsDeleteSamples { - /** - * Sample code: Delete an application control machine group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAnApplicationControlMachineGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.adaptiveApplicationControls().deleteWithResponse("centralus", "GROUP1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java deleted file mode 100644 index e62f4c352572..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveApplicationControls Get. */ -public final class AdaptiveApplicationControlsGetSamples { - /** - * Sample code: Gets a configured application control VM/server group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsAConfiguredApplicationControlVMServerGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java deleted file mode 100644 index e1d992dcbe28..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveApplicationControls List. */ -public final class AdaptiveApplicationControlsListSamples { - /** - * Sample code: Gets a list of application control groups of machines for the subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.adaptiveApplicationControls().listWithResponse(true, false, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.java deleted file mode 100644 index 472b6f6fa989..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.PublisherInfo; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserRecommendation; -import com.azure.resourcemanager.security.models.VmRecommendation; -import java.util.Arrays; - -/** Samples for AdaptiveApplicationControls Put. */ -public final class AdaptiveApplicationControlsPutSamples { - /** - * Sample code: Update an application control machine group by adding a new application. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateAnApplicationControlMachineGroupByAddingANewApplication( - com.azure.resourcemanager.security.SecurityManager securityManager) { - AdaptiveApplicationControlGroup resource = - securityManager - .adaptiveApplicationControls() - .getWithResponse("centralus", "ERELGROUP1", Context.NONE) - .getValue(); - resource - .update() - .withEnforcementMode(EnforcementMode.AUDIT) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.AUDIT) - .withMsi(EnforcementMode.NONE) - .withScript(EnforcementMode.NONE)) - .withVmRecommendations( - Arrays - .asList( - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.CONFIGURED) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090") - .withEnforcementSupport(EnforcementSupport.SUPPORTED), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.CONFIGURED) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19") - .withEnforcementSupport(EnforcementSupport.SUPPORTED))) - .withPathRecommendations( - Arrays - .asList( - new PathRecommendation() - .withPath("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0") - .withAction(RecommendationAction.RECOMMENDED) - .withType(RecommendationType.fromString("PublisherSignature")) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US") - .withProductName("*") - .withBinaryName("*") - .withVersion("0.0.0.0")) - .withCommon(true) - .withUserSids(Arrays.asList("S-1-1-0")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("Everyone") - .withRecommendationAction(RecommendationAction.RECOMMENDED))) - .withFileType(FileType.EXE) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED), - new PathRecommendation() - .withPath("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE") - .withAction(RecommendationAction.RECOMMENDED) - .withType(RecommendationType.fromString("ProductSignature")) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") - .withProductName("MICROSOFT® COREXT") - .withBinaryName("*") - .withVersion("0.0.0.0")) - .withCommon(true) - .withUserSids(Arrays.asList("S-1-1-0")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("NT AUTHORITY\\SYSTEM") - .withRecommendationAction(RecommendationAction.RECOMMENDED))) - .withFileType(FileType.EXE) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED), - new PathRecommendation() - .withPath("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE") - .withAction(RecommendationAction.RECOMMENDED) - .withType(RecommendationType.fromString("PublisherSignature")) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") - .withProductName("*") - .withBinaryName("*") - .withVersion("0.0.0.0")) - .withCommon(true) - .withUserSids(Arrays.asList("S-1-1-0")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("NT AUTHORITY\\SYSTEM") - .withRecommendationAction(RecommendationAction.RECOMMENDED))) - .withFileType(FileType.EXE) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED), - new PathRecommendation() - .withPath("C:\\directory\\file.exe") - .withAction(RecommendationAction.ADD) - .withType(RecommendationType.fromString("File")) - .withCommon(true))) - .apply(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.java deleted file mode 100644 index 9011173cba00..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.util.Arrays; - -/** Samples for AdaptiveNetworkHardenings Enforce. */ -public final class AdaptiveNetworkHardeningsEnforceSamples { - /** - * Sample code: Enforces the given rules on the NSG(s) listed in the request. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void enforcesTheGivenRulesOnTheNSGSListedInTheRequest( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .adaptiveNetworkHardenings() - .enforce( - "rg1", - "Microsoft.Compute", - "virtualMachines", - "vm1", - "default", - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("rule1") - .withDirection(Direction.INBOUND) - .withDestinationPort(3389) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("100.10.1.1", "200.20.2.2", "81.199.3.0/24")), - new Rule() - .withName("rule2") - .withDirection(Direction.INBOUND) - .withDestinationPort(22) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList()))) - .withNetworkSecurityGroups( - Arrays - .asList( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java deleted file mode 100644 index 0d1e20e81570..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveNetworkHardenings Get. */ -public final class AdaptiveNetworkHardeningsGetSamples { - /** - * Sample code: Get a single Adaptive Network Hardening resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getASingleAdaptiveNetworkHardeningResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .adaptiveNetworkHardenings() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java deleted file mode 100644 index 6743e63ee6ba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ -public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { - /** - * Sample code: List Adaptive Network Hardenings resources of an extended resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listAdaptiveNetworkHardeningsResourcesOfAnExtendedResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .adaptiveNetworkHardenings() - .listByExtendedResource("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java deleted file mode 100644 index 0bc3582019c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -/** Samples for AdvancedThreatProtection Create. */ -public final class AdvancedThreatProtectionCreateSamples { - /** - * Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .advancedThreatProtections() - .define() - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") - .withIsEnabled(true) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java deleted file mode 100644 index d5ebfab412dc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AdvancedThreatProtection Get. */ -public final class AdvancedThreatProtectionGetSamples { - /** - * Sample code: Gets the Advanced Threat Protection settings for the specified resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .advancedThreatProtections() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java deleted file mode 100644 index a4d871536624..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts GetResourceGroupLevel. */ -public final class AlertsGetResourceGroupLevelSamples { - /** - * Sample code: Get security alert on a resource group from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .getResourceGroupLevelWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", "myRg1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java deleted file mode 100644 index e6dca7c21ae2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts GetSubscriptionLevel. */ -public final class AlertsGetSubscriptionLevelSamples { - /** - * Sample code: Get security alert on a subscription from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .getSubscriptionLevelWithResponse( - "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java deleted file mode 100644 index f17ef8759418..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts ListByResourceGroup. */ -public final class AlertsListByResourceGroupSamples { - /** - * Sample code: Get security alerts on a resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertsOnAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().listByResourceGroup("myRg1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java deleted file mode 100644 index 4299958e9ee5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts ListResourceGroupLevelByRegion. */ -public final class AlertsListResourceGroupLevelByRegionSamples { - /** - * Sample code: Get security alerts on a resource group from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java deleted file mode 100644 index f2bfab347cfc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts List. */ -public final class AlertsListSamples { - /** - * Sample code: Get security alerts on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java deleted file mode 100644 index da603a3f3829..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts ListSubscriptionLevelByRegion. */ -public final class AlertsListSubscriptionLevelByRegionSamples { - /** - * Sample code: Get security alerts on a subscription from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().listSubscriptionLevelByRegion("westeurope", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.java deleted file mode 100644 index e8871599cf37..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import com.azure.resourcemanager.security.models.BundleType; -import java.util.Arrays; - -/** Samples for Alerts Simulate. */ -public final class AlertsSimulateSamples { - /** - * Sample code: Simulate security alerts on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void simulateSecurityAlertsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .simulate( - "centralus", - new AlertSimulatorRequestBody() - .withProperties( - new AlertSimulatorBundlesRequestProperties() - .withBundles( - Arrays - .asList( - BundleType.APP_SERVICES, - BundleType.DNS, - BundleType.KEY_VAULTS, - BundleType.KUBERNETES_SERVICE, - BundleType.RESOURCE_MANAGER, - BundleType.SQL_SERVERS, - BundleType.STORAGE_ACCOUNTS, - BundleType.VIRTUAL_MACHINES))), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java deleted file mode 100644 index b04c72b50712..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AlertsSuppressionRules Delete. */ -public final class AlertsSuppressionRulesDeleteSamples { - /** - * Sample code: Delete suppression rule data for a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteSuppressionRuleDataForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java deleted file mode 100644 index bce501954a7a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AlertsSuppressionRules Get. */ -public final class AlertsSuppressionRulesGetSamples { - /** - * Sample code: Get suppression alert rule for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSuppressionAlertRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java deleted file mode 100644 index d105b5ebea0b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AlertsSuppressionRules List. */ -public final class AlertsSuppressionRulesListSamples { - /** - * Sample code: Get suppression rules for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSuppressionRulesForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().list(null, Context.NONE); - } - - /** - * Sample code: Get suppression alert rule for subscription, filtered by AlertType. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().list("IpAnomaly", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java deleted file mode 100644 index d28b4c4013a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.ScopeElement; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; -import java.util.Arrays; - -/** Samples for AlertsSuppressionRules Update. */ -public final class AlertsSuppressionRulesUpdateSamples { - /** - * Sample code: Update or create suppression rule for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateOrCreateSuppressionRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alertsSuppressionRules() - .updateWithResponse( - "dismissIpAnomalyAlerts", - new AlertsSuppressionRuleInner() - .withAlertType("IpAnomaly") - .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) - .withReason("FalsePositive") - .withState(RuleState.ENABLED) - .withComment("Test VM") - .withSuppressionAlertsScope( - new SuppressionAlertsScope() - .withAllOf( - Arrays - .asList( - new ScopeElement().withField("entities.ip.address"), - new ScopeElement().withField("entities.process.commandline")))), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java deleted file mode 100644 index c93454266a09..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ -public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .updateResourceGroupLevelStateToActivateWithResponse( - "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java deleted file mode 100644 index 9480ea6334c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ -public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .updateResourceGroupLevelStateToDismissWithResponse( - "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java deleted file mode 100644 index 979eacb0e4ea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ -public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .updateResourceGroupLevelStateToResolveWithResponse( - "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java deleted file mode 100644 index 1c79383ea6de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ -public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .updateSubscriptionLevelStateToActivateWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java deleted file mode 100644 index 063a15d27614..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ -public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .updateSubscriptionLevelStateToDismissWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java deleted file mode 100644 index 301b29f467de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ -public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alerts() - .updateSubscriptionLevelStateToResolveWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java deleted file mode 100644 index 8e5ceeae6b07..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ConnectionType; - -/** Samples for AllowedConnections Get. */ -public final class AllowedConnectionsGetSamples { - /** - * Sample code: Get allowed connections. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .allowedConnections() - .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java deleted file mode 100644 index f8fdee135aef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AllowedConnections ListByHomeRegion. */ -public final class AllowedConnectionsListByHomeRegionSamples { - /** - * Sample code: Get allowed connections on a subscription from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.allowedConnections().listByHomeRegion("centralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java deleted file mode 100644 index d3301223298a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AllowedConnections List. */ -public final class AllowedConnectionsListSamples { - /** - * Sample code: Get allowed connections on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllowedConnectionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.allowedConnections().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java deleted file mode 100644 index 71325ee1b975..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.AssessmentStatusCode; -import com.azure.resourcemanager.security.models.AzureResourceDetails; - -/** Samples for Assessments CreateOrUpdate. */ -public final class AssessmentsCreateOrUpdateSamples { - /** - * Sample code: Create security recommendation task on a resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createSecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessments() - .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") - .withResourceDetails(new AzureResourceDetails()) - .withStatus(new AssessmentStatus().withCode(AssessmentStatusCode.HEALTHY)) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java deleted file mode 100644 index c95270597fe8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Assessments Delete. */ -public final class AssessmentsDeleteSamples { - /** - * Sample code: Delete a security recommendation task on a resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteASecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessments() - .deleteWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "8bb8be0a-6010-4789-812f-e4d661c4ed0e", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.java deleted file mode 100644 index c64fb805494d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ExpandEnum; - -/** Samples for Assessments Get. */ -public final class AssessmentsGetSamples { - /** - * Sample code: Get security recommendation task from security data location with expand parameter. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessments() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "21300918-b2e3-0346-785f-c77ff57d243b", - ExpandEnum.LINKS, - Context.NONE); - } - - /** - * Sample code: Get security recommendation task from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessments() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "21300918-b2e3-0346-785f-c77ff57d243b", - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java deleted file mode 100644 index f0b9d5c95373..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Assessments List. */ -public final class AssessmentsListSamples { - /** - * Sample code: List security assessments. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java deleted file mode 100644 index 8c2e3722177d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import java.util.Arrays; - -/** Samples for AssessmentsMetadata CreateInSubscription. */ -public final class AssessmentsMetadataCreateInSubscriptionSamples { - /** - * Sample code: Create security assessment metadata for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessmentsMetadatas() - .define("ca039e75-a276-4175-aebc-bcd41e4b14b7") - .withDisplayName("Install endpoint protection solution on virtual machine scale sets") - .withDescription( - "Install an endpoint protection solution on your virtual machines scale sets, to protect them from" - + " threats and vulnerabilities.") - .withRemediationDescription( - "To install an endpoint protection solution: 1. Follow" - + " the instructions in How do I turn on antimalware in my virtual machine scale set") - .withCategories(Arrays.asList(Categories.COMPUTE)) - .withSeverity(Severity.MEDIUM) - .withUserImpact(UserImpact.LOW) - .withImplementationEffort(ImplementationEffort.LOW) - .withThreats(Arrays.asList(Threats.DATA_EXFILTRATION, Threats.DATA_SPILLAGE, Threats.MALICIOUS_INSIDER)) - .withAssessmentType(AssessmentType.CUSTOMER_MANAGED) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java deleted file mode 100644 index f67e791be433..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata DeleteInSubscription. */ -public final class AssessmentsMetadataDeleteInSubscriptionSamples { - /** - * Sample code: Delete a security assessment metadata for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteASecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessmentsMetadatas() - .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java deleted file mode 100644 index 513b3070de02..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata GetInSubscription. */ -public final class AssessmentsMetadataGetInSubscriptionSamples { - /** - * Sample code: Get security assessment metadata for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .assessmentsMetadatas() - .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java deleted file mode 100644 index 88ca93e16d66..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata Get. */ -public final class AssessmentsMetadataGetSamples { - /** - * Sample code: Get security assessment metadata. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAssessmentMetadata( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java deleted file mode 100644 index d7d669ee7a16..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata ListBySubscription. */ -public final class AssessmentsMetadataListBySubscriptionSamples { - /** - * Sample code: List security assessment metadata for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessmentsMetadatas().listBySubscription(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java deleted file mode 100644 index d585b083bc2f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata List. */ -public final class AssessmentsMetadataListSamples { - /** - * Sample code: List security assessment metadata. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityAssessmentMetadata( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessmentsMetadatas().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java deleted file mode 100644 index 92ce0509faf4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.resourcemanager.security.models.AutoProvision; - -/** Samples for AutoProvisioningSettings Create. */ -public final class AutoProvisioningSettingsCreateSamples { - /** - * Sample code: Create auto provisioning settings for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java deleted file mode 100644 index ddd48fe7eeb0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AutoProvisioningSettings Get. */ -public final class AutoProvisioningSettingsGetSamples { - /** - * Sample code: Get an auto provisioning setting for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAnAutoProvisioningSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.autoProvisioningSettings().getWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java deleted file mode 100644 index b3c1dca86f1b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for AutoProvisioningSettings List. */ -public final class AutoProvisioningSettingsListSamples { - /** - * Sample code: Get auto provisioning settings for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.autoProvisioningSettings().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.java deleted file mode 100644 index 83c4006099e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.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; - -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.EventSource; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Automations CreateOrUpdate. */ -public final class AutomationsCreateOrUpdateSamples { - /** - * Sample code: Create or update a security automation for all assessments (including all severities). - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" - + " assessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) - .create(); - } - - /** - * Sample code: Disable or enable a security automation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void disableOrEnableASecurityAutomation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" - + " assessment of type customAssessment") - .withIsEnabled(false) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("$.Entity.AssessmentType") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("customAssessment") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) - .create(); - } - - /** - * Sample code: Create or update a security automation for all high severity assessments. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any high" - + " severity security assessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("properties.metadata.severity") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("High") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java deleted file mode 100644 index d585a60e0068..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Automations Delete. */ -public final class AutomationsDeleteSamples { - /** - * Sample code: Delete a security automation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.automations().deleteWithResponse("myRg", "myAutomationName", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java deleted file mode 100644 index 99afedcd551c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Automations GetByResourceGroup. */ -public final class AutomationsGetByResourceGroupSamples { - /** - * Sample code: Retrieve a security automation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .automations() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java deleted file mode 100644 index 6c915da44fc3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Automations ListByResourceGroup. */ -public final class AutomationsListByResourceGroupSamples { - /** - * Sample code: List all security automations of a specified resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.automations().listByResourceGroup("exampleResourceGroup", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java deleted file mode 100644 index f6c94c83785c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Automations List. */ -public final class AutomationsListSamples { - /** - * Sample code: List all security automations of a specified subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listAllSecurityAutomationsOfASpecifiedSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.automations().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.java deleted file mode 100644 index e0f22b8ea6e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.EventSource; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Automations Validate. */ -public final class AutomationsValidateSamples { - /** - * Sample code: Validate the security automation model before create or update. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .automations() - .validateWithResponse( - "exampleResourceGroup", - "exampleAutomation", - new AutomationInner() - .withLocation("Central US") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any" - + " security assessment of type customAssessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security" - + " assessments that relate to the resource group myResourceGroup within" - + " the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("$.Entity.AssessmentType") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("customAssessment") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))), - Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java deleted file mode 100644 index 8e71d2c666e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ComplianceResults Get. */ -public final class ComplianceResultsGetSamples { - /** - * Sample code: Get compliance results on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getComplianceResultsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .complianceResults() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java deleted file mode 100644 index 8651c5df1f20..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ComplianceResults List. */ -public final class ComplianceResultsListSamples { - /** - * Sample code: Get compliance results on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getComplianceResultsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.complianceResults().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java deleted file mode 100644 index 01a4b15de0c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Compliances Get. */ -public final class CompliancesGetSamples { - /** - * Sample code: Get security compliance data for a day. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityComplianceDataForADay( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .compliances() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java deleted file mode 100644 index 11bb2ab6ac87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Compliances List. */ -public final class CompliancesListSamples { - /** - * Sample code: Get security compliance data over time. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityComplianceDataOverTime( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.compliances().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.java deleted file mode 100644 index 6ab5decade7b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.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; - -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import com.azure.resourcemanager.security.models.ProxyServerProperties; -import com.azure.resourcemanager.security.models.ServicePrincipalProperties; - -/** Samples for Connectors CreateOrUpdate. */ -public final class ConnectorsCreateOrUpdateSamples { - /** - * Sample code: gcpCredentials - Create a cloud account connector for a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .connectors() - .define("gcp_dev") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) - .withAuthenticationDetails( - new GcpCredentialsDetailsProperties() - .withOrganizationId("AscDemoOrg") - .withType("service_account") - .withProjectId("asc-project-1234") - .withPrivateKeyId("6efg587hra2568as34d22326b044cc20dc2af") - .withPrivateKey( - "-----BEGIN PRIVATE KEY-----\n" - + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpxYHcLzcDZ6/Q\n" - + "AeQZnQXM5GTb3p09Xsbjo2T2F61b6I7FZiQXBrbw3Zf0CUCkkqTTpD5xifl82yQ6\n" - + "89V7SAe8hxI7esAcVDhm/aJMqzVjHLISAU2L3li1sn0jjY2oYtndwN6bRivP8O6t\n" - + "9F+W6E0zMlbCxtpZEHLbb6WxlJJrwEQ0MPH2yOCwZUQi6NHksAtEzX2nNKJNyUC7\n" - + "QyBVHHMm34H2bmZwsuQp3y2otpcJ9tJnVmYfC3k/w4x2L+DIK7JnQP/C1wQqu2du\n" - + "c0w6sydF6RhLoHButrVdYRJTdfK4k03SsSTyMqZ+f7LNnKw3xenzw1VmEpk8mvoQ\n" - + "t08tCBOrAgMBAAECggEAByzz6iyMtLYjNjV+QJ7kad6VbL2iA8AHxANZ9xTVHPdd\n" - + "YXaJu/dqsA+NpqDlfI8+LDva782XH/HbPCqmMUnAGfXTjXQIvqnIoIHD5F2wKfpC\n" - + "hIRNlMXXFgbvRxtqi11yO+80+XcjzuwuCmgzyhsTeEB+bkkdXXpWgHPdmv3emnM6\n" - + "MQM9Zgrug0UndPmiUwKOcJSU4PlmlTpHEV4vA6JfA4bvphy9m1jxO5qWeah5yym2\n" - + "6FP5BRIDF98kFrDnSXJjajwgLCQ+MypFQXyax6XkxDxuKXbng1bv7eZDjqazIChk\n" - + "m0y14X0s0jnWc+AX8vfeSf7d+EsGdVinEwR1aAawEQKBgQDqDB0qxcIQ1oI1Kww8\n" - + "9vXefTiuWsf47F+fJ/DIOEbiRfE8IdCgmOABvcqJIoxW/DFMBEdLCcx73Km7pOmd\n" - + "Kg1ddScnaO8cOj2v/Ub+fAqVrA4ki4ViYP0A7/Nogga3Jr/x3ey5bitrIfFImteS\n" - + "CgBHBzZvoQpvO4lB2tKVgo2P9wKBgQC5sgTEq4sasRGSAY6lIoJno0I8w28a/16D\n" - + "es60XQeY1ger8uTGwlT02v/u/arDUmRLPClpujXq6gK29KvtRCHy7JkpGbqW2bZs\n" - + "PFKKWR7Tk3XPKYyjv94AIi5/xoFeDhS4lpAvy3Z5tQhYS6wqWKvT6yZQ3kM+Hfxs\n" - + "pHgvu3mU7QKBgQC9/E1k3hj1cBtMK4CIsHPPQljTd4+iacYJPPPAo6YuoVX8WPqw\n" - + "ksgrwbN59Fh1d8xQh5yTtgWOegYx8uFMGcm1lpbM7+pBQKm4hWGuzGQPMRZd5f/F\n" - + "ZzOZIi61I+9tlv/yxxIVR+/ozCm/pSneO04UWi9/F/uPZYW6tnWAtfRR6wKBgGsZ\n" - + "8MQaCK4JaI/klAhMghgSQnbXZXKVzUZaA3Rln6cX8u7KtgapOOTMlwaZie8Dy1LV\n" - + "TTFstAJcm9o3/h1nyYjZy3C4JTUyNpPwqs6enjf7edxVI4eidwFutZD+xcigqHTa\n" - + "aikW2atSrZB3fMIjyF7+5meH+hKOqvNiXOty3qn1AoGAZuVxYQy5FVq3YZxzr3Aa\n" - + "Am0ShoXTF6QYIbsaUiUGoa/NlHcw9V/lj4AqBRbxbaYMD+hz2J/od9cb268eJKY8\n" - + "3b6MvaUqdNhNnWodJXLhgtmGEHDKmTppz2JSTx/tVzCfhFdcOC79StZvcKLhtoFQ\n" - + "+/3lEw6NCIXzm5E4+dtJG4k=\n" - + "-----END PRIVATE KEY-----\n") - .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") - .withClientId("105889053725632919854") - .withAuthUri("https://accounts.google.com/o/oauth2/auth") - .withTokenUri("https://oauth2.googleapis.com/token") - .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") - .withClientX509CertUrl( - "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) - .create(); - } - - /** - * Sample code: AwsCred - Create a cloud account connector for a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void awsCredCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .connectors() - .define("aws_dev1") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret(""))) - .withAuthenticationDetails( - new AwsCredsAuthenticationDetailsProperties() - .withAwsAccessKeyId("AKIARPZCNODDNAEQFSOE") - .withAwsSecretAccessKey("")) - .create(); - } - - /** - * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .connectors() - .define("aws_dev2") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret(""))) - .withAuthenticationDetails( - new AwAssumeRoleAuthenticationDetailsProperties() - .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") - .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java deleted file mode 100644 index ec0a2aefeede..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Connectors Delete. */ -public final class ConnectorsDeleteSamples { - /** - * Sample code: Delete a cloud account connector from a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteACloudAccountConnectorFromASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.connectors().deleteWithResponse("aws_dev1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java deleted file mode 100644 index 3e917841ce23..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Connectors Get. */ -public final class ConnectorsGetSamples { - /** - * Sample code: Details of a specific cloud account connector. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void detailsOfASpecificCloudAccountConnector( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.connectors().getWithResponse("aws_dev1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java deleted file mode 100644 index 5b366d2f8e5a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Connectors List. */ -public final class ConnectorsListSamples { - /** - * Sample code: Get all cloud accounts connectors of a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllCloudAccountsConnectorsOfASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.connectors().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java deleted file mode 100644 index 2e2dc5bde383..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Device Get. */ -public final class DeviceGetSamples { - /** - * Sample code: Get Device. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDevice(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .devices() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Devices/iotHubs/myHub", - "myDevice", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java deleted file mode 100644 index 1a9fc303bef9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; -import java.time.Duration; -import java.util.Arrays; - -/** Samples for DeviceSecurityGroups CreateOrUpdate. */ -public final class DeviceSecurityGroupsCreateOrUpdateSamples { - /** - * Sample code: Create or update a device security group for the specified IoT hub resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .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(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java deleted file mode 100644 index 1d020d236723..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DeviceSecurityGroups Delete. */ -public final class DeviceSecurityGroupsDeleteSamples { - /** - * Sample code: Delete a device security group for the specified IoT Hub resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .deviceSecurityGroups() - .deleteWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java deleted file mode 100644 index e4aa1153ce3a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DeviceSecurityGroups Get. */ -public final class DeviceSecurityGroupsGetSamples { - /** - * Sample code: Get a device security group for the specified IoT Hub resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .deviceSecurityGroups() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java deleted file mode 100644 index 5858a1d45d04..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DeviceSecurityGroups List. */ -public final class DeviceSecurityGroupsListSamples { - /** - * Sample code: List all device security groups for the specified IoT Hub resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .deviceSecurityGroups() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java deleted file mode 100644 index fc582ed600ac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DevicesForHub List. */ -public final class DevicesForHubListSamples { - /** - * Sample code: Get Devices. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDevices(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .devicesForHubs() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Devices/iotHubs/myHub", - null, - null, - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java deleted file mode 100644 index f8187d948e4b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DevicesForSubscription List. */ -public final class DevicesForSubscriptionListSamples { - /** - * Sample code: Get Devices. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDevices(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.devicesForSubscriptions().list(null, null, null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java deleted file mode 100644 index 72a730fbc66c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DiscoveredSecuritySolutions Get. */ -public final class DiscoveredSecuritySolutionsGetSamples { - /** - * Sample code: Get discovered security solution from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java deleted file mode 100644 index e7f1fd990581..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ -public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { - /** - * Sample code: Get discovered security solutions from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.discoveredSecuritySolutions().listByHomeRegion("centralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java deleted file mode 100644 index 28db6da64956..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for DiscoveredSecuritySolutions List. */ -public final class DiscoveredSecuritySolutionsListSamples { - /** - * Sample code: Get discovered security solutions. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDiscoveredSecuritySolutions( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.discoveredSecuritySolutions().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java deleted file mode 100644 index 4037da239892..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ExternalSecuritySolutions Get. */ -public final class ExternalSecuritySolutionsGetSamples { - /** - * Sample code: Get external security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .externalSecuritySolutions() - .getWithResponse( - "defaultresourcegroup-eus", - "centralus", - "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java deleted file mode 100644 index 9912c79417fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ExternalSecuritySolutions ListByHomeRegion. */ -public final class ExternalSecuritySolutionsListByHomeRegionSamples { - /** - * Sample code: Get external security solutions on a subscription from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.externalSecuritySolutions().listByHomeRegion("centralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java deleted file mode 100644 index 48ab7a09d10f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ExternalSecuritySolutions List. */ -public final class ExternalSecuritySolutionsListSamples { - /** - * Sample code: Get external security solutions on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getExternalSecuritySolutionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.externalSecuritySolutions().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.java deleted file mode 100644 index 302f064f2457..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.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; - -import com.azure.resourcemanager.security.models.InformationProtectionKeyword; -import com.azure.resourcemanager.security.models.InformationProtectionPoliciesInformationProtectionPolicyName; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** Samples for InformationProtectionPolicies CreateOrUpdate. */ -public final class InformationProtectionPoliciesCreateOrUpdateSamples { - /** - * Sample code: Create or update an information protection policy for a management group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .informationProtectionPolicies() - .define(InformationProtectionPoliciesInformationProtectionPolicyName.CUSTOM) - .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") - .withLabels( - mapOf( - "1345da73-bc5a-4a8f-b7dd-3820eb713da8", - new SensitivityLabel().withDisplayName("Public").withOrder(100).withEnabled(true), - "575739d2-3d53-4df0-9042-4c7772d5c7b1", - new SensitivityLabel().withDisplayName("Confidential").withOrder(300).withEnabled(true), - "7aa516c7-5a53-4857-bc6e-6808c6acd542", - new SensitivityLabel().withDisplayName("General").withOrder(200).withEnabled(true))) - .withInformationTypes( - mapOf( - "3bf35491-99b8-41f2-86d5-c1200a7df658", - new InformationType() - .withDisplayName("Custom") - .withOrder(1400) - .withRecommendedLabelId(UUID.fromString("7aa516c7-5a53-4857-bc6e-6808c6acd542")) - .withEnabled(true) - .withCustom(true) - .withKeywords( - Arrays - .asList( - new InformationProtectionKeyword() - .withPattern("%custom%") - .withCustom(true) - .withCanBeNumeric(true))), - "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07", - new InformationType() - .withDisplayName("Networking") - .withOrder(100) - .withRecommendedLabelId(UUID.fromString("575739d2-3d53-4df0-9042-4c7772d5c7b1")) - .withEnabled(true) - .withCustom(false) - .withKeywords( - Arrays - .asList( - new InformationProtectionKeyword() - .withPattern("%networking%") - .withCustom(true) - .withCanBeNumeric(false))))) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.java deleted file mode 100644 index 1892817035b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.InformationProtectionPoliciesInformationProtectionPolicyName; - -/** Samples for InformationProtectionPolicies Get. */ -public final class InformationProtectionPoliciesGetSamples { - /** - * Sample code: Get the customized information protection policy for a management group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .informationProtectionPolicies() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - InformationProtectionPoliciesInformationProtectionPolicyName.CUSTOM, - Context.NONE); - } - - /** - * Sample code: Get the effective information protection policy for a management group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .informationProtectionPolicies() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - InformationProtectionPoliciesInformationProtectionPolicyName.EFFECTIVE, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java deleted file mode 100644 index ae86d7fba7ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for InformationProtectionPolicies List. */ -public final class InformationProtectionPoliciesListSamples { - /** - * Sample code: Get information protection policies. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getInformationProtectionPolicies( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .informationProtectionPolicies() - .list("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java deleted file mode 100644 index cd2dc021468d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -/** Samples for IngestionSettings Create. */ -public final class IngestionSettingsCreateSamples { - /** - * Sample code: Create an ingestion setting for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createAnIngestionSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().define("default").create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java deleted file mode 100644 index f9d9e84a733a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings Delete. */ -public final class IngestionSettingsDeleteSamples { - /** - * Sample code: Delete an ingestion setting for the subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAnIngestionSettingForTheSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().deleteWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java deleted file mode 100644 index 45cc1459f570..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings Get. */ -public final class IngestionSettingsGetSamples { - /** - * Sample code: Get a ingestion setting on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAIngestionSettingOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().getWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java deleted file mode 100644 index 8a37257f9de1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings ListConnectionStrings. */ -public final class IngestionSettingsListConnectionStringsSamples { - /** - * Sample code: List connection strings for ingesting security data and logs. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listConnectionStringsForIngestingSecurityDataAndLogs( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().listConnectionStringsWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java deleted file mode 100644 index b1f9e1617707..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings List. */ -public final class IngestionSettingsListSamples { - /** - * Sample code: Get ingestion settings on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIngestionSettingsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java deleted file mode 100644 index c1c4f2e63867..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings ListTokens. */ -public final class IngestionSettingsListTokensSamples { - /** - * Sample code: List ingestion setting tokens. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().listTokensWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java deleted file mode 100644 index 24879ed4aed6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotAlertTypes Get. */ -public final class IotAlertTypesGetSamples { - /** - * Sample code: Get IoT Alert Type. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTAlertType(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotAlertTypes().getWithResponse("IoT_PrivilegedContainer", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java deleted file mode 100644 index e61b455e14b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotAlertTypes List. */ -public final class IotAlertTypesListSamples { - /** - * Sample code: Get IoT Alert Types. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTAlertTypes(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotAlertTypes().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java deleted file mode 100644 index 60f2c4c170b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotAlerts Get. */ -public final class IotAlertsGetSamples { - /** - * Sample code: Get IoT Alert. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTAlert(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotAlerts() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java deleted file mode 100644 index 1f67f3a03cbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotAlerts List. */ -public final class IotAlertsListSamples { - /** - * Sample code: List IoT Alerts. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTAlerts(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotAlerts() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "2020-05-12T06:32:25Z", - "2020-05-14T06:32:25Z", - "IoT_PrivilegedContainer", - null, - "device-1", - 1, - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java deleted file mode 100644 index 153eaa5c6cf5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.models.OnboardingKind; -import java.util.Arrays; - -/** Samples for IotDefenderSettings CreateOrUpdate. */ -public final class IotDefenderSettingsCreateOrUpdateSamples { - /** - * Sample code: Create or update IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateIoTDefenderSettings( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotDefenderSettings() - .createOrUpdateWithResponse( - new IotDefenderSettingsModelInner() - .withDeviceQuota(2000) - .withSentinelWorkspaceResourceIds( - Arrays - .asList( - "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1")) - .withOnboardingKind(OnboardingKind.DEFAULT), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java deleted file mode 100644 index 81925420fcbb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings Delete. */ -public final class IotDefenderSettingsDeleteSamples { - /** - * Sample code: Delete IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteIoTDefenderSettings(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().deleteWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java deleted file mode 100644 index 23e4e40e92e4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings DownloadManagerActivation. */ -public final class IotDefenderSettingsDownloadManagerActivationSamples { - /** - * Sample code: Download quota data of the subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadQuotaDataOfTheSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().downloadManagerActivationWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java deleted file mode 100644 index c3627e773e03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings Get. */ -public final class IotDefenderSettingsGetSamples { - /** - * Sample code: Get IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTDefenderSettings(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().getWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java deleted file mode 100644 index 11890b702fb2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings List. */ -public final class IotDefenderSettingsListSamples { - /** - * Sample code: List IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTDefenderSettings(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java deleted file mode 100644 index 1529def74d7b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings PackageDownloads. */ -public final class IotDefenderSettingsPackageDownloadsSamples { - /** - * Sample code: Package downloads. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void packageDownloads(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().packageDownloadsWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java deleted file mode 100644 index 4b79a23a5715..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendationTypes Get. */ -public final class IotRecommendationTypesGetSamples { - /** - * Sample code: Get IoT Recommendation Type. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendationType(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotRecommendationTypes().getWithResponse("IoT_VulnerableTLSCipherSuite", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java deleted file mode 100644 index 22b48bdfb08a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendationTypes List. */ -public final class IotRecommendationTypesListSamples { - /** - * Sample code: Get IoT Recommendation Types. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendationTypes(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotRecommendationTypes().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java deleted file mode 100644 index f263bb6a4f44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendations Get. */ -public final class IotRecommendationsGetSamples { - /** - * Sample code: Get IoT Recommendation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotRecommendations() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java deleted file mode 100644 index dbce2d71a170..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendations List. */ -public final class IotRecommendationsListSamples { - /** - * Sample code: Get IoT Recommendations. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendations(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotRecommendations() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "IoT_Baseline", - "device-1", - 1, - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java deleted file mode 100644 index 4642868787e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionAnalytics Get. */ -public final class IotSecuritySolutionAnalyticsGetSamples { - /** - * Sample code: Get Security Solution Analytics. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutionAnalytics( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java deleted file mode 100644 index cec08a427ba0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionAnalytics List. */ -public final class IotSecuritySolutionAnalyticsListSamples { - /** - * Sample code: Get Security Solution Analytics. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutionAnalytics( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.java deleted file mode 100644 index 87f966cfdd6f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.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; - -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 { - /** - * Sample code: Create or update a IoT security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateAIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutions() - .define("default") - .withExistingResourceGroup("MyGroup") - .withRegion("East Us") - .withTags(mapOf()) - .withWorkspace( - "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1") - .withDisplayName("Solution Default") - .withStatus(SecuritySolutionStatus.ENABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs( - Arrays - .asList( - "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\"") - .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withStatus(RecommendationConfigStatus.DISABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java deleted file mode 100644 index f0600963ce35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolution Delete. */ -public final class IotSecuritySolutionDeleteSamples { - /** - * Sample code: Delete an IoT security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().deleteWithResponse("MyGroup", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java deleted file mode 100644 index ed945a50d5c1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolution GetByResourceGroup. */ -public final class IotSecuritySolutionGetByResourceGroupSamples { - /** - * Sample code: Get a IoT security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java deleted file mode 100644 index eb3aa2b24ddd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolution ListByResourceGroup. */ -public final class IotSecuritySolutionListByResourceGroupSamples { - /** - * Sample code: List IoT Security solutions by resource group and IoT Hub. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutions() - .listByResourceGroup( - "MyRg", - "properties.iotHubs/any(i eq" - + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - Context.NONE); - } - - /** - * Sample code: List IoT Security solutions by resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSecuritySolutionsByResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java deleted file mode 100644 index 3a0c7317723b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolution List. */ -public final class IotSecuritySolutionListSamples { - /** - * Sample code: List IoT Security solutions by subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSecuritySolutionsBySubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().list(null, Context.NONE); - } - - /** - * Sample code: List IoT Security solutions by IoT Hub. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSecuritySolutionsByIoTHub( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutions() - .list( - "properties.iotHubs/any(i eq" - + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.java deleted file mode 100644 index 5dca3cda751a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for IotSecuritySolution Update. */ -public final class IotSecuritySolutionUpdateSamples { - /** - * Sample code: Use this method to update existing IoT Security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void useThisMethodToUpdateExistingIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - IoTSecuritySolutionModel resource = - securityManager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("myRg", "default", Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("foo", "bar")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\"") - .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withStatus(RecommendationConfigStatus.DISABLED))) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java deleted file mode 100644 index ea59f30cb66f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { - /** - * Sample code: Dismiss an aggregated IoT Security Solution Alert. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void dismissAnAggregatedIoTSecuritySolutionAlert( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java deleted file mode 100644 index 0a70c532e187..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { - /** - * Sample code: Get the aggregated security analytics alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void - getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java deleted file mode 100644 index a68339927781..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { - /** - * Sample code: Get the aggregated alert list of yours IoT Security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java deleted file mode 100644 index 3489f2cc9db6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ -public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { - /** - * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java deleted file mode 100644 index 01f29343e7f1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ -public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { - /** - * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutionsAnalyticsRecommendations() - .list("IoTEdgeResources", "default", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java deleted file mode 100644 index 682b79417f82..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.resourcemanager.security.models.SensorType; - -/** Samples for IotSensors CreateOrUpdate. */ -public final class IotSensorsCreateOrUpdateSamples { - /** - * Sample code: Create or update IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .define("mySensor") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub") - .withTiAutomaticUpdates(true) - .withZone("Zone Name") - .withSensorType(SensorType.OT) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java deleted file mode 100644 index 6f7544ae3927..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSensors Delete. */ -public final class IotSensorsDeleteSamples { - /** - * Sample code: Delete IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .deleteWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java deleted file mode 100644 index cb4a2d3485ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSensors DownloadActivation. */ -public final class IotSensorsDownloadActivationSamples { - /** - * Sample code: Download activation file. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadActivationFile(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .downloadActivationWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java deleted file mode 100644 index 9391e038d43e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ResetPasswordInput; - -/** Samples for IotSensors DownloadResetPassword. */ -public final class IotSensorsDownloadResetPasswordSamples { - /** - * Sample code: Download file for reset password of the sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadFileForResetPasswordOfTheSensor( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .downloadResetPasswordWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - new ResetPasswordInput().withApplianceId("3214-528AV23-D121-D3-E1"), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java deleted file mode 100644 index 10f599c4f262..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSensors Get. */ -public final class IotSensorsGetSamples { - /** - * Sample code: Get IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java deleted file mode 100644 index 278adafdf475..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSensors List. */ -public final class IotSensorsListSamples { - /** - * Sample code: List IoT sensors. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSensors(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .listWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java deleted file mode 100644 index 99992f345ee1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSensors TriggerTiPackageUpdate. */ -public final class IotSensorsTriggerTiPackageUpdateSamples { - /** - * Sample code: Trigger threat intelligence package update. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void triggerThreatIntelligencePackageUpdate( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .triggerTiPackageUpdateWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java deleted file mode 100644 index 3893e87887cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import java.util.HashMap; -import java.util.Map; - -/** Samples for IotSites CreateOrUpdate. */ -public final class IotSitesCreateOrUpdateSamples { - /** - * Sample code: Create or update IoT site. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateIoTSite(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .createOrUpdateWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - new IotSitesModelInner() - .withDisplayName("IoT site name") - .withTags(mapOf("key1", "value1", "key2", "value2")), - Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java deleted file mode 100644 index 2d78d9d27514..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSites Delete. */ -public final class IotSitesDeleteSamples { - /** - * Sample code: Delete IoT site. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteIoTSite(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .deleteWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java deleted file mode 100644 index 59ac6f43a72d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSites Get. */ -public final class IotSitesGetSamples { - /** - * Sample code: Get IoT site. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTSite(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java deleted file mode 100644 index a354baf95fb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for IotSites List. */ -public final class IotSitesListSamples { - /** - * Sample code: List IoT sites. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSites(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .listWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/iotSites", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.java deleted file mode 100644 index bf559ca05268..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.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; - -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import com.azure.resourcemanager.security.models.ProtocolValue; -import com.azure.resourcemanager.security.models.Status; -import com.azure.resourcemanager.security.models.StatusReason; -import java.time.OffsetDateTime; -import java.util.Arrays; - -/** Samples for JitNetworkAccessPolicies CreateOrUpdate. */ -public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { - /** - * Sample code: Create JIT network access policy. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .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(ProtocolValue.ASTERISK) - .withAllowedSourceAddressPrefix("*") - .withMaxRequestAccessDuration("PT3H"), - new JitNetworkAccessPortRule() - .withNumber(3389) - .withProtocol(ProtocolValue.ASTERISK) - .withAllowedSourceAddressPrefix("*") - .withMaxRequestAccessDuration("PT3H"))))) - .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"))) - .withKind("Basic") - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java deleted file mode 100644 index ac94ddbc9659..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies Delete. */ -public final class JitNetworkAccessPoliciesDeleteSamples { - /** - * Sample code: Delete a JIT network access policy. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java deleted file mode 100644 index ce7349262ca7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies Get. */ -public final class JitNetworkAccessPoliciesGetSamples { - /** - * Sample code: Get JIT network access policy. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.java deleted file mode 100644 index 43649aef6b62..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import java.util.Arrays; - -/** Samples for JitNetworkAccessPolicies Initiate. */ -public final class JitNetworkAccessPoliciesInitiateSamples { - /** - * Sample code: Initiate an action on a JIT network access policy. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void initiateAnActionOnAJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .jitNetworkAccessPolicies() - .initiateWithResponse( - "myRg1", - "westeurope", - "default", - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPolicyInitiatePort() - .withNumber(3389) - .withAllowedSourceAddressPrefix("192.127.0.2"))))) - .withJustification("testing a new version of the product"), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java deleted file mode 100644 index 0f8fc45db0b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies ListByRegion. */ -public final class JitNetworkAccessPoliciesListByRegionSamples { - /** - * Sample code: Get JIT network access policies on a subscription from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().listByRegion("westeurope", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java deleted file mode 100644 index e6f026cb04e5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ -public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { - /** - * Sample code: Get JIT network access policies on a resource group from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java deleted file mode 100644 index f72d5fd8f1dc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ -public final class JitNetworkAccessPoliciesListByResourceGroupSamples { - /** - * Sample code: Get JIT network access policies on a resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getJITNetworkAccessPoliciesOnAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java deleted file mode 100644 index dc07fc66348a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies List. */ -public final class JitNetworkAccessPoliciesListSamples { - /** - * Sample code: Get JIT network access policies on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getJITNetworkAccessPoliciesOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java deleted file mode 100644 index faa57df79bab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Locations Get. */ -public final class LocationsGetSamples { - /** - * Sample code: Get security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.locations().getWithResponse("centralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java deleted file mode 100644 index b81a22baab76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Locations List. */ -public final class LocationsListSamples { - /** - * Sample code: Get security data locations. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.locations().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java deleted file mode 100644 index a692138b096d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors CreateOrUpdate. */ -public final class OnPremiseIotSensorsCreateOrUpdateSamples { - /** - * Sample code: Create or update on-premise IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateOnPremiseIoTSensor( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().createOrUpdateWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java deleted file mode 100644 index 4c5e7fe5f417..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors Delete. */ -public final class OnPremiseIotSensorsDeleteSamples { - /** - * Sample code: Delete on-premise IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteOnPremiseIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().deleteWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java deleted file mode 100644 index e6ae685eb165..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors DownloadActivation. */ -public final class OnPremiseIotSensorsDownloadActivationSamples { - /** - * Sample code: Download activation file. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadActivationFile(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().downloadActivationWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java deleted file mode 100644 index 7d1fa3b3f8a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ResetPasswordInput; - -/** Samples for OnPremiseIotSensors DownloadResetPassword. */ -public final class OnPremiseIotSensorsDownloadResetPasswordSamples { - /** - * Sample code: Download file for reset password of the sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadFileForResetPasswordOfTheSensor( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .onPremiseIotSensors() - .downloadResetPasswordWithResponse( - "mySensor", new ResetPasswordInput().withApplianceId("3214-528AV23-D121-D3-E1"), Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java deleted file mode 100644 index 7552e6bf529c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors Get. */ -public final class OnPremiseIotSensorsGetSamples { - /** - * Sample code: Get on-premise IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getOnPremiseIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().getWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java deleted file mode 100644 index 327e18c41bdf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors List. */ -public final class OnPremiseIotSensorsListSamples { - /** - * Sample code: List on-premise IoT sensors. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listOnPremiseIoTSensors(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java deleted file mode 100644 index fc2e9bb56a0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Pricings Get. */ -public final class PricingsGetSamples { - /** - * Sample code: Get pricings on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.pricings().getWithResponse("VirtualMachines", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java deleted file mode 100644 index 703d0d9cd5ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Pricings List. */ -public final class PricingsListSamples { - /** - * Sample code: Get pricings on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.pricings().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java deleted file mode 100644 index 9102510c307d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.PricingTier; - -/** Samples for Pricings Update. */ -public final class PricingsUpdateSamples { - /** - * Sample code: Update pricing on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updatePricingOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .pricings() - .updateWithResponse( - "VirtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD), Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java deleted file mode 100644 index af1bb81d6ace..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for RegulatoryComplianceAssessments Get. */ -public final class RegulatoryComplianceAssessmentsGetSamples { - /** - * Sample code: Get selected regulatory compliance assessment details and state. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .regulatoryComplianceAssessments() - .getWithResponse("PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java deleted file mode 100644 index 3099ee7d6f2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for RegulatoryComplianceAssessments List. */ -public final class RegulatoryComplianceAssessmentsListSamples { - /** - * Sample code: Get all assessments mapped to selected regulatory compliance control. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java deleted file mode 100644 index ffac6ffea7a7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for RegulatoryComplianceControls Get. */ -public final class RegulatoryComplianceControlsGetSamples { - /** - * Sample code: Get selected regulatory compliance control details and state. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSelectedRegulatoryComplianceControlDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java deleted file mode 100644 index a3e8b3ffc374..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for RegulatoryComplianceControls List. */ -public final class RegulatoryComplianceControlsListSamples { - /** - * Sample code: Get all regulatory compliance controls details and state for selected standard. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java deleted file mode 100644 index 7931c47fff84..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for RegulatoryComplianceStandards Get. */ -public final class RegulatoryComplianceStandardsGetSamples { - /** - * Sample code: Get selected regulatory compliance standard details and state. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSelectedRegulatoryComplianceStandardDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java deleted file mode 100644 index d9a460ad5280..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for RegulatoryComplianceStandards List. */ -public final class RegulatoryComplianceStandardsListSamples { - /** - * Sample code: Get all supported regulatory compliance standards details and state. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceStandards().list(null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java deleted file mode 100644 index 4929da4c92ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecureScoreControlDefinitions ListBySubscription. */ -public final class SecureScoreControlDefinitionsListBySubscriptionSamples { - /** - * Sample code: List security controls definition by subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityControlsDefinitionBySubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControlDefinitions().listBySubscription(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java deleted file mode 100644 index 5d5f79bad2d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecureScoreControlDefinitions List. */ -public final class SecureScoreControlDefinitionsListSamples { - /** - * Sample code: List security controls definition. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityControlsDefinition( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControlDefinitions().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java deleted file mode 100644 index 92b5ede6edea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; - -/** Samples for SecureScoreControls ListBySecureScore. */ -public final class SecureScoreControlsListBySecureScoreSamples { - /** - * Sample code: Get security controls and their current score for the specified initiative with the expand - * parameter. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .secureScoreControls() - .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE); - } - - /** - * Sample code: Get security controls and their current score for the specified initiative. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java deleted file mode 100644 index 262f583cae53..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecureScoreControls List. */ -public final class SecureScoreControlsListSamples { - /** - * Sample code: List all secure scores controls. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControls().list(null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java deleted file mode 100644 index ce64877674c8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecureScores Get. */ -public final class SecureScoresGetSamples { - /** - * Sample code: Get single secure score. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScores().getWithResponse("ascScore", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java deleted file mode 100644 index a8a2cbd57a9a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecureScores List. */ -public final class SecureScoresListSamples { - /** - * Sample code: List secure scores. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScores().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.java deleted file mode 100644 index 8122f57a22c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.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; - -import com.azure.resourcemanager.security.models.AlertNotifications; -import com.azure.resourcemanager.security.models.AlertsToAdmins; - -/** Samples for SecurityContacts Create. */ -public final class SecurityContactsCreateSamples { - /** - * Sample code: Create security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .securityContacts() - .define("default2") - .withEmail("chen@contoso.com") - .withAlertNotifications(AlertNotifications.ON) - .withAlertsToAdmins(AlertsToAdmins.ON) - .create(); - } - - /** - * Sample code: Create security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createSecurityContactDataFull( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .securityContacts() - .define("default1") - .withEmail("john@contoso.com") - .withPhone("(214)275-4038") - .withAlertNotifications(AlertNotifications.ON) - .withAlertsToAdmins(AlertsToAdmins.ON) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java deleted file mode 100644 index 5242484431a4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecurityContacts Delete. */ -public final class SecurityContactsDeleteSamples { - /** - * Sample code: Delete security contact data. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteSecurityContactData(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().deleteWithResponse("default1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java deleted file mode 100644 index 9d98c0995eb7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecurityContacts Get. */ -public final class SecurityContactsGetSamples { - /** - * Sample code: Get security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().getWithResponse("default2", Context.NONE); - } - - /** - * Sample code: Get security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().getWithResponse("default1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java deleted file mode 100644 index 85e587a4b698..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecurityContacts List. */ -public final class SecurityContactsListSamples { - /** - * Sample code: Update security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().list(Context.NONE); - } - - /** - * Sample code: Update security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataFull( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java deleted file mode 100644 index b4835ab9df5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.AlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContact; - -/** Samples for SecurityContacts Update. */ -public final class SecurityContactsUpdateSamples { - /** - * Sample code: Update security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - SecurityContact resource = - securityManager.securityContacts().getWithResponse("default2", Context.NONE).getValue(); - resource.update().withAlertNotifications(AlertNotifications.ON).apply(); - } - - /** - * Sample code: Update security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataFull( - com.azure.resourcemanager.security.SecurityManager securityManager) { - SecurityContact resource = securityManager.securityContacts().getWithResponse("john", Context.NONE).getValue(); - resource.update().withPhone("(214)275-4038").withAlertNotifications(AlertNotifications.ON).apply(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java deleted file mode 100644 index 596a9e2a93ef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecuritySolutions Get. */ -public final class SecuritySolutionsGetSamples { - /** - * Sample code: Get a security solution from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getASecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java deleted file mode 100644 index 5de8ab0b45af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecuritySolutions List. */ -public final class SecuritySolutionsListSamples { - /** - * Sample code: Get security solutions. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutions().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java deleted file mode 100644 index 571a17b95883..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ -public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { - /** - * Sample code: Get security solutions from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java deleted file mode 100644 index a4dee50417a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SecuritySolutionsReferenceData List. */ -public final class SecuritySolutionsReferenceDataListSamples { - /** - * Sample code: Get security solutions. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutionsReferenceDatas().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java deleted file mode 100644 index b16ff165ae2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ -public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { - /** - * Sample code: Create a server vulnerability assessments on a resource. Only 'default' resource is supported. Once - * creating the resource, the server will be onboarded to vulnerability assessment by Microsoft.Security. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void - createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .serverVulnerabilityAssessments() - .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java deleted file mode 100644 index a76d502b5ed6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ServerVulnerabilityAssessment Delete. */ -public final class ServerVulnerabilityAssessmentDeleteSamples { - /** - * Sample code: Delete a server vulnerability assessments on a resource. Only 'default' resource is supported. Once - * deleting, Microsoft.Security will not provide vulnerability assessment findings on the resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void - deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .serverVulnerabilityAssessments() - .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java deleted file mode 100644 index 7e6e17855d72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ServerVulnerabilityAssessment Get. */ -public final class ServerVulnerabilityAssessmentGetSamples { - /** - * Sample code: Get a server vulnerability assessments onboarding status on a resource. Currently Microsoft.Security - * only supports the single 'default' resource. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void - getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .serverVulnerabilityAssessments() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java deleted file mode 100644 index 202571e39bef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ -public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { - /** - * Sample code: Get a list of server vulnerability assessments on a resource. Though this API returns a list, - * Currently Microsoft.Security only supports a single default type of server vulnerability assessment. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void - getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java deleted file mode 100644 index 4d6cec7b9c8f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.SettingsSettingName; - -/** Samples for Settings Get. */ -public final class SettingsGetSamples { - /** - * Sample code: Get a setting on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.settings().getWithResponse(SettingsSettingName.MCAS, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java deleted file mode 100644 index b2ee58f03c97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Settings List. */ -public final class SettingsListSamples { - /** - * Sample code: Get settings of subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.settings().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java deleted file mode 100644 index d637c330428b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.DataExportSettings; -import com.azure.resourcemanager.security.models.SettingsSettingName; - -/** Samples for Settings Update. */ -public final class SettingsUpdateSamples { - /** - * Sample code: Update a setting for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateASettingForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .settings() - .updateWithResponse(SettingsSettingName.MCAS, new DataExportSettings().withEnabled(true), Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java deleted file mode 100644 index 5fa329832916..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SoftwareInventories Get. */ -public final class SoftwareInventoriesGetSamples { - /** - * Sample code: Gets a single software data of the virtual machine. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsASingleSoftwareDataOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .softwareInventories() - .getWithResponse( - "EITAN-TESTS", - "Microsoft.Compute", - "virtualMachines", - "Eitan-Test1", - "outlook_16.0.10371.20060", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java deleted file mode 100644 index 64db12e3120d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SoftwareInventories ListByExtendedResource. */ -public final class SoftwareInventoriesListByExtendedResourceSamples { - /** - * Sample code: Gets the software inventory of the virtual machine. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsTheSoftwareInventoryOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .softwareInventories() - .listByExtendedResource("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java deleted file mode 100644 index 5f65508eeca0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SoftwareInventories List. */ -public final class SoftwareInventoriesListSamples { - /** - * Sample code: Gets the software inventory of all virtual machines in the subscriptions. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.softwareInventories().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java deleted file mode 100644 index cd69b7e6cb06..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ -public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { - /** - * Sample code: Create a baseline for all rules. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createABaselineForAllRules(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - new RulesResultsInput() - .withLatestScan(false) - .withResults( - mapOf( - "VA1234", - Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), - "VA5678", - Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), - Context.NONE); - } - - /** - * Sample code: Create a baseline for all rules using the latest scan results. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createABaselineForAllRulesUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - new RulesResultsInput().withLatestScan(true).withResults(mapOf()), - Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java deleted file mode 100644 index d941f2e4dd0e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.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; - -import java.util.Arrays; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ -public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { - /** - * Sample code: Create a baseline using the latest scan results. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createABaselineUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .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(); - } - - /** - * Sample code: Create a baseline. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createABaseline(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .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(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java deleted file mode 100644 index ec5faa465280..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ -public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { - /** - * Sample code: Delete the baseline. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteTheBaseline(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentBaselineRules() - .deleteWithResponse( - "VA1234", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java deleted file mode 100644 index a4fff784603f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ -public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { - /** - * Sample code: Get the baseline. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTheBaseline(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentBaselineRules() - .getWithResponse( - "VA1234", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java deleted file mode 100644 index ad21bbf21e93..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ -public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { - /** - * Sample code: List baseline for all rules. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listBaselineForAllRules(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentBaselineRules() - .listWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.java deleted file mode 100644 index 33b6c2a56644..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentScanResults Get. */ -public final class SqlVulnerabilityAssessmentScanResultsGetSamples { - /** - * Sample code: Get scan details of a scan record. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse( - "Scheduled-20200623", - "VA2063", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } - - /** - * Sample code: Get scan details of the latest scan record. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getScanDetailsOfTheLatestScanRecord( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse( - "latest", - "VA2063", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.java deleted file mode 100644 index ede5d3ca69bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentScanResults List. */ -public final class SqlVulnerabilityAssessmentScanResultsListSamples { - /** - * Sample code: List scan results of the latest scan. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listScanResultsOfTheLatestScan( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse( - "latest", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } - - /** - * Sample code: List scan results. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listScanResults(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse( - "Scheduled-20200623", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.java deleted file mode 100644 index 5df8d2e1d252..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentScans Get. */ -public final class SqlVulnerabilityAssessmentScansGetSamples { - /** - * Sample code: Get scan details of a scan record. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScans() - .getWithResponse( - "Scheduled-20200623", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } - - /** - * Sample code: Get scan details of the latest scan record. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getScanDetailsOfTheLatestScanRecord( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScans() - .getWithResponse( - "latest", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java deleted file mode 100644 index 35629aea0442..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SqlVulnerabilityAssessmentScans List. */ -public final class SqlVulnerabilityAssessmentScansListSamples { - /** - * Sample code: List scan details. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listScanDetails(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .sqlVulnerabilityAssessmentScans() - .listWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java deleted file mode 100644 index f714507b11e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SubAssessments Get. */ -public final class SubAssessmentsGetSamples { - /** - * Sample code: Get security recommendation task from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .subAssessments() - .getWithResponse( - "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", - "1195afff-c881-495e-9bc5-1486211ae03f", - "95f7da9c-a2a4-1322-0758-fcd24ef09b85", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java deleted file mode 100644 index 5ba4c8288269..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SubAssessments ListAll. */ -public final class SubAssessmentsListAllSamples { - /** - * Sample code: List security sub-assessments. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java deleted file mode 100644 index a69467e5ef4f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for SubAssessments List. */ -public final class SubAssessmentsListSamples { - /** - * Sample code: List security sub-assessments. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .subAssessments() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "82e20e14-edc5-4373-bfc4-f13121257c37", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java deleted file mode 100644 index 4928c649965c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Tasks GetResourceGroupLevelTask. */ -public final class TasksGetResourceGroupLevelTaskSamples { - /** - * Sample code: Get security recommendation task in a resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationTaskInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .tasks() - .getResourceGroupLevelTaskWithResponse( - "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java deleted file mode 100644 index 3bc50fc31eb8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Tasks GetSubscriptionLevelTask. */ -public final class TasksGetSubscriptionLevelTaskSamples { - /** - * Sample code: Get security recommendation task from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .tasks() - .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java deleted file mode 100644 index 6b4fe6c36456..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Tasks ListByHomeRegion. */ -public final class TasksListByHomeRegionSamples { - /** - * Sample code: Get security recommendations tasks from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationsTasksFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.tasks().listByHomeRegion("westeurope", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java deleted file mode 100644 index 7aee116bcf29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Tasks ListByResourceGroup. */ -public final class TasksListByResourceGroupSamples { - /** - * Sample code: Get security recommendation tasks in a resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationTasksInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.tasks().listByResourceGroup("myRg", "westeurope", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java deleted file mode 100644 index 0738f549721a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Tasks List. */ -public final class TasksListSamples { - /** - * Sample code: Get security recommendations tasks. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationsTasks( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.tasks().list(null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java deleted file mode 100644 index 07300cb1ca0c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.TasksTaskUpdateActionType; - -/** Samples for Tasks UpdateResourceGroupLevelTaskState. */ -public final class TasksUpdateResourceGroupLevelTaskStateSamples { - /** - * Sample code: Change security recommendation task state. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .tasks() - .updateResourceGroupLevelTaskStateWithResponse( - "myRg", - "westeurope", - "d55b4dc0-779c-c66c-33e5-d7bce24c4222", - TasksTaskUpdateActionType.DISMISS, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java deleted file mode 100644 index 6b2bcdbaf26b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.TasksTaskUpdateActionType; - -/** Samples for Tasks UpdateSubscriptionLevelTaskState. */ -public final class TasksUpdateSubscriptionLevelTaskStateSamples { - /** - * Sample code: Change security recommendation task state. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .tasks() - .updateSubscriptionLevelTaskStateWithResponse( - "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", TasksTaskUpdateActionType.DISMISS, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java deleted file mode 100644 index 1df814b85263..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Topology Get. */ -public final class TopologyGetSamples { - /** - * Sample code: Get topology. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTopology(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.topologies().getWithResponse("myservers", "centralus", "vnets", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java deleted file mode 100644 index f0e2b21c8786..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Topology ListByHomeRegion. */ -public final class TopologyListByHomeRegionSamples { - /** - * Sample code: Get topology on a subscription from security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTopologyOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.topologies().listByHomeRegion("centralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java deleted file mode 100644 index a9ee3b001676..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for Topology List. */ -public final class TopologyListSamples { - /** - * Sample code: Get topology on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.topologies().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java deleted file mode 100644 index d115370a96eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -/** Samples for WorkspaceSettings Create. */ -public final class WorkspaceSettingsCreateSamples { - /** - * Sample code: Create a workspace setting data for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .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(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java deleted file mode 100644 index e3c3c33d96ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for WorkspaceSettings Delete. */ -public final class WorkspaceSettingsDeleteSamples { - /** - * Sample code: Delete a workspace setting data for resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAWorkspaceSettingDataForResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.workspaceSettings().deleteWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java deleted file mode 100644 index 45f39f7d9df6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for WorkspaceSettings Get. */ -public final class WorkspaceSettingsGetSamples { - /** - * Sample code: Get a workspace setting on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAWorkspaceSettingOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.workspaceSettings().getWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java deleted file mode 100644 index 50f641d10f02..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; - -/** Samples for WorkspaceSettings List. */ -public final class WorkspaceSettingsListSamples { - /** - * Sample code: Get workspace settings on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getWorkspaceSettingsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.workspaceSettings().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java deleted file mode 100644 index 6aa8064d0b98..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.WorkspaceSetting; - -/** Samples for WorkspaceSettings Update. */ -public final class WorkspaceSettingsUpdateSamples { - /** - * Sample code: Update a workspace setting data for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - WorkspaceSetting resource = - securityManager.workspaceSettings().getWithResponse("default", Context.NONE).getValue(); - resource - .update() - .withWorkspaceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") - .apply(); - } -}